summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Oblock <gary@amperecomputing.com>2020-06-12 00:24:48 -0700
committerGary Oblock <gary@amperecomputing.com>2020-06-12 00:24:48 -0700
commited6642af4835582bea6ec22e1b8442a3e90be194 (patch)
tree269984a1c9cb5d4ed41ae7aa0b1009d0b98b0fc8
parent8d37b300d1849ca8c35e2f5c50c0fafc952ec2ae (diff)
working on more transforms and old code with issues.
-rw-r--r--gcc/ipa-str-reorg-instance-interleave.c93
-rw-r--r--gcc/ipa-structure-reorg.h4
2 files changed, 55 insertions, 42 deletions
diff --git a/gcc/ipa-str-reorg-instance-interleave.c b/gcc/ipa-str-reorg-instance-interleave.c
index d14b51abe66..b22d5bc594e 100644
--- a/gcc/ipa-str-reorg-instance-interleave.c
+++ b/gcc/ipa-str-reorg-instance-interleave.c
@@ -49,8 +49,11 @@ static void str_reorg_instance_interleave_type_part ( Info *);
static void create_new_types ( Info_t *);
static void create_a_new_type ( Info_t *, tree);
static unsigned int reorg_perf_qual ( Info *);
+
+// These are local to this file by design
+#define REORG_SP_PTR_PREFIX "_reorg_SP_ptr_type_"
+#define REORG_SP_PREFIX "_reorg_base_type_"
-#if USE_NEW_INTERFACE
int
str_reorg_instance_interleave_qual ( Info *info)
{
@@ -174,32 +177,45 @@ str_reorg_instance_interleave_trans ( Info *info)
break;
case ReorgT_ElemAssign:
DEBUG_L("ReorgT_ElemAssign\n");
- /*
- tree lhs = gimple_assign_lhs( stmt);
- tree rhs = gimple_assign_rhs( stmt);
- switch( recognize_op( rhs, info) {
- case ReorgT_Indirect: // "a->f"
- // Note, there are lot's of missing low level details here
- A,B are new SSA
- // type_name( rhs) is a little sloppy because it's the type
- // name if the "a" that matters and not the type name of
- // "a->f."
- generate A <- concat( REORG_SP_PREFIX, type_name( rhs))
- and insert before stmt
- generate B <- A->"f"
- and insert before stmt
- generate lhs <- B
- and insert before stmt
- delete stmt
- break;
- // Not implemented in single pool
- //case ReorgT_AryDir: // "x[i].f"
- default:
- internal_error(
- "Reached operand default for ReorgT_Indirect");
- }
- delete stmt
- */
+ // Needed for helloworld
+ #if 0
+ tree lhs = gimple_assign_lhs( stmt);
+ tree rhs = gimple_assign_rhs( stmt);
+ switch ( recognize_op( rhs, info))
+ {
+ case ReorgT_Indirect: // "a->f"
+ {
+ // Note, there are lot's of missing low level details here
+ // A,B are new SSA
+ tree temp_A =
+ make_temp_ssa_name( sizetype, NULL, "temp_A");
+ tree temp_B =
+ make_temp_ssa_name( sizetype, NULL, "temp_B");
+ // type_name( rhs) is a little sloppy because it's the type
+ // name if the "a" that matters and not the type name of
+ // "a->f."
+
+ // generate A <- concat( REORG_SP_PREFIX, type_name( rhs))
+ // and insert before stmt
+
+ // generate B <- A->"f"
+ // and insert before stmt
+
+ // generate lhs <- B
+ // and insert before stmt
+
+ //delete stmt
+ }
+ break;
+ case ReorgT_AryDir: // "x[i].f"
+ // Not implemented in single pool
+ internal_error ( "ReorgT_AryDir not possible");
+ default:
+ internal_error (
+ "Reached operand default for ReorgT_Indirect");
+ }
+ // delete stmt
+ #endif
break;
case ReorgT_If_Null:
case ReorgT_If_NotNull:
@@ -220,6 +236,7 @@ str_reorg_instance_interleave_trans ( Info *info)
break;
case ReorgT_PtrPlusInt: // "a = b + i"
DEBUG_L("ReorgT_PtrPlusInt\n");
+ // Needed for hellowotrld
/*
// Does the type of stmt need to be adjusted? I assume so.
// The ReorgType contains the type of the pointer
@@ -708,6 +725,7 @@ str_reorg_instance_interleave_trans ( Info *info)
*/
break;
case ReorgT_UserFunc:
+ // Needed for helloworld.
// TBD The type must be adjusted (maybe.)
DEBUG_L("ReorgT_UserFunc\n");
break;
@@ -724,17 +742,6 @@ str_reorg_instance_interleave_trans ( Info *info)
}
}
-#else
-int
-// Returns one if something was done and zero otherwise.
-str_reorg_instance_interleave ( Info *info)
-{
- // TBD
- // DEBUG ( "Running str_reorg_instance_interleave\n");
- return 0;
-}
-#endif
-
static void
str_reorg_instance_interleave_qual_part ( Info *info)
{
@@ -841,7 +848,6 @@ create_a_new_type ( Info_t *info, tree type)
tree pointer_rep = make_node ( INTEGER_TYPE);
TYPE_PRECISION ( pointer_rep) =
TYPE_PRECISION ( pointer_sized_int_node);
- #define REORG_SP_PTR_PREFIX "_reorg_SP_ptr_type_"
//DEBUG("Issue with gcc_ of reorg\n");
//DEBUG_F(print_reorg, stderr, 2, ri);
const char *gcc_name =
@@ -853,9 +859,16 @@ create_a_new_type ( Info_t *info, tree type)
strcat ( name, gcc_name);
TYPE_NAME ( pointer_rep) = get_identifier ( name);
ri->pointer_rep = pointer_rep;
+
+ // TBD ! Some of the key bits from above seem to be missing below.
+ // Specifically make_node for the base type, setting the base (clone)
+ // in the ReorgType.
+ //
+ // Note, someplace (probably here) also has to declare a base type
+ // variable (probably globally.) Doesn't this variable also belong
+ // in the ReorgType?
// Set name of reorg_type_prime
- #define REORG_SP_PREFIX "_reorg_base_type_"
// TBD shouldn't base_type_name be different from gcc_name above
const char *base_type_name =
identifier_to_locale ( IDENTIFIER_POINTER ( TYPE_NAME ( ri->gcc_type)));
diff --git a/gcc/ipa-structure-reorg.h b/gcc/ipa-structure-reorg.h
index 04d96426cb5..75aa8f385c1 100644
--- a/gcc/ipa-structure-reorg.h
+++ b/gcc/ipa-structure-reorg.h
@@ -48,7 +48,7 @@ struct RT_Interleave {
double reorg_perf;
double regular_perf;
bool multi_pool; // single pool if not set
- int dummy;
+ int dummy;
};
typedef struct ReorgType ReorgType_t;
@@ -60,7 +60,7 @@ typedef struct ReorgType ReorgType_t;
// Not sure how it will evolve in the future...
struct ReorgType {
unsigned id;
- tree gcc_type;
+ tree gcc_type; // This info is for this type.
bool delete_me;
// TBD will field reordering and/or dead field elimination use
// use the clone? I think it's likely that they can.