summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Oblock <gary@amperecomputing.com>2020-05-18 13:56:19 -0700
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-06-03 16:05:27 +0200
commit3b71706ec3b3700a09c09780dc76dbdb85e957c6 (patch)
tree23bf70c1fbff82401846a49bf2387ce59b3267f7
parent788476c8695432710836eb9240c2bd8bcb63e8c7 (diff)
new iterface under define USE_NEW_INTERFACE
-rw-r--r--gcc/ipa-str-reorg-dead-field-eliminate.c15
-rw-r--r--gcc/ipa-str-reorg-field-reorder.c13
-rw-r--r--gcc/ipa-str-reorg-instance-interleave.c15
-rw-r--r--gcc/ipa-structure-reorg.c46
-rw-r--r--gcc/ipa-structure-reorg.h11
5 files changed, 99 insertions, 1 deletions
diff --git a/gcc/ipa-str-reorg-dead-field-eliminate.c b/gcc/ipa-str-reorg-dead-field-eliminate.c
index 727033bc6c0..77f9d3141b2 100644
--- a/gcc/ipa-str-reorg-dead-field-eliminate.c
+++ b/gcc/ipa-str-reorg-dead-field-eliminate.c
@@ -2760,3 +2760,18 @@ str_reorg_dead_field_eliminate (__attribute__((unused)) Info *info)
gcc_assert (in_lto_p);
return iphw_execute ();
}
+
+#if USE_NEW_INTERFACE
+int
+str_reorg_dead_field_eliminate_qual (Info *info)
+{
+ return 0;
+}
+int
+str_reorg_dead_field_eliminate_trans (Info *info)
+{
+ return 0;
+}
+#endif
+
+
diff --git a/gcc/ipa-str-reorg-field-reorder.c b/gcc/ipa-str-reorg-field-reorder.c
index 5c9a2bb0b9b..67e2b147718 100644
--- a/gcc/ipa-str-reorg-field-reorder.c
+++ b/gcc/ipa-str-reorg-field-reorder.c
@@ -45,3 +45,16 @@ str_reorg_field_reorder (Info *info)
// DEBUG ( "Running str_reorg_field_reorder\n");
return 0;
}
+
+#if USE_NEW_INTERFACE
+int
+str_reorg_field_reorder_qual (Info *info)
+{
+ return 0;
+}
+int
+str_reorg_field_reorder_trans (Info *info)
+{
+ return 0;
+}
+#endif
diff --git a/gcc/ipa-str-reorg-instance-interleave.c b/gcc/ipa-str-reorg-instance-interleave.c
index 2b5d4afd81b..cb519e0b496 100644
--- a/gcc/ipa-str-reorg-instance-interleave.c
+++ b/gcc/ipa-str-reorg-instance-interleave.c
@@ -38,6 +38,18 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "langhooks.h"
+#if USE_NEW_INTERFACE
+int
+str_reorg_instance_interleave_qual ( Info *)
+{
+ return 0;
+}
+int
+str_reorg_instance_interleave_trans ( Info *)
+{
+ return 0;
+}
+#else
int
// Returns one if something was done and zero otherwise.
str_reorg_instance_interleave (Info *info)
@@ -46,3 +58,6 @@ str_reorg_instance_interleave (Info *info)
// DEBUG ( "Running str_reorg_instance_interleave\n");
return 0;
}
+#endif
+
+
diff --git a/gcc/ipa-structure-reorg.c b/gcc/ipa-structure-reorg.c
index 5629cd7724d..3034e35bda2 100644
--- a/gcc/ipa-structure-reorg.c
+++ b/gcc/ipa-structure-reorg.c
@@ -55,9 +55,11 @@ static void disq_str_in_str_or_union_helper ( tree,
std::set<tree> *,
Info_t *);
static unsigned int reorg_qualification ( Info_t *);
-static bool transformation_legality( Info_t *);
+static bool transformation_legality ( Info_t *);
static void transformation_legality_debug ( Info *, ReorgType *);
static bool reorg_legality ( Info_t *);
+static void reorg_common_middle_code ( Info_t *);
+static void modify_declarations ( Info_t *);
static void reorg_forbidden ( gimple *, Info_t *);
// Name changed and moved to its own file
//static void reorg_transformation ( Info_t *);
@@ -133,6 +135,35 @@ ipa_structure_reorg ( void)
if ( reorg_qualification ( &info) )
{
+ #if USE_NEW_INTERFACE
+ if ( flag_ipa_structure_reorg || flag_ipa_dead_field_eliminate )
+ {
+ str_reorg_dead_field_eliminate_qual ( &info);
+ }
+ if ( flag_ipa_structure_reorg || flag_ipa_field_reorder )
+ {
+ str_reorg_field_reorder_qual ( &info);
+ }
+ if ( flag_ipa_structure_reorg || flag_ipa_instance_interleave )
+ {
+ str_reorg_instance_interleave_qual ( &info);
+ }
+
+ reorg_common_middle_code( &info); // ??? might not amount to anything
+
+ if ( flag_ipa_structure_reorg || flag_ipa_dead_field_eliminate )
+ {
+ str_reorg_dead_field_eliminate_trans ( &info);
+ }
+ if ( flag_ipa_structure_reorg || flag_ipa_field_reorder )
+ {
+ str_reorg_field_reorder_trans ( &info);
+ }
+ if ( flag_ipa_structure_reorg || flag_ipa_instance_interleave )
+ {
+ str_reorg_instance_interleave_trans ( &info);
+ }
+ #else
// Each of these do their own performance qualification and
// if they delete any types they must invoke restore_deleted_types
// so the next subpass has all the types to consider.
@@ -148,6 +179,7 @@ ipa_structure_reorg ( void)
if ( flag_ipa_structure_reorg || flag_ipa_instance_interleave ) {
str_reorg_instance_interleave ( &info);
}
+ #endif
}
final_debug_info ( &info);
@@ -857,6 +889,18 @@ transformation_legality_debug ( Info *info, ReorgType *reorg )
}
}
+static void
+reorg_common_middle_code ( Info_t *info)
+{
+ modify_declarations( info);
+}
+
+static void
+modify_declarations ( Info_t *info)
+{
+ // TBD
+}
+
void
delete_reorgtype ( ReorgType_t *rt, Info_t *info )
{
diff --git a/gcc/ipa-structure-reorg.h b/gcc/ipa-structure-reorg.h
index 9526929571a..6f66cbea674 100644
--- a/gcc/ipa-structure-reorg.h
+++ b/gcc/ipa-structure-reorg.h
@@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USE_NEW_INTERFACE 1
+
typedef struct ReorgType ReorgType_t;
struct ReorgType {
unsigned id;
@@ -118,9 +120,18 @@ struct Info {
// reorg type. It's primarily to support debugging.
typedef void (*ReorgFn)( Info *, ReorgType_t *);
+#if USE_NEW_INTERFACE
+extern int str_reorg_dead_field_eliminate_qual ( Info *);
+extern int str_reorg_dead_field_eliminate_trans ( Info *);
+extern int str_reorg_field_reorder_qual ( Info *);
+extern int str_reorg_field_reorder_trans ( Info *);
+extern int str_reorg_instance_interleave_qual ( Info *);
+extern int str_reorg_instance_interleave_trans ( Info *);
+#else
extern int str_reorg_dead_field_eliminate ( Info *);
extern int str_reorg_field_reorder ( Info *);
extern int str_reorg_instance_interleave ( Info *);
+#endif
extern void delete_reorgtype ( ReorgType_t *, Info_t *);
extern void undelete_reorgtype ( ReorgType_t *, Info_t *);