aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Coplan <alex.coplan@arm.com>2023-08-17 16:16:46 +0100
committerAlex Coplan <alex.coplan@arm.com>2023-10-19 11:12:22 +0100
commitba230aa1b855c32d5414183b604e45ce836fb532 (patch)
tree77387387c4ecd886113d2df5a1a09dba4917e0bc
parentc95aab23c152115cd567541dd134f3fab6f45e78 (diff)
downloadgcc-ba230aa1b855c32d5414183b604e45ce836fb532.zip
gcc-ba230aa1b855c32d5414183b604e45ce836fb532.tar.gz
gcc-ba230aa1b855c32d5414183b604e45ce836fb532.tar.bz2
rtl-ssa: Add entry point to allow re-parenting uses
This is needed by the upcoming aarch64 load pair pass, as it can re-order stores (when alias analysis determines this is safe) and thus change which mem def a given use consumes (in the RTL-SSA view, there is no alias disambiguation of memory). gcc/ChangeLog: * rtl-ssa/accesses.cc (function_info::reparent_use): New. * rtl-ssa/functions.h (function_info): Declare new member function reparent_use.
-rw-r--r--gcc/rtl-ssa/accesses.cc8
-rw-r--r--gcc/rtl-ssa/functions.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rtl-ssa/accesses.cc b/gcc/rtl-ssa/accesses.cc
index f12b5f4..774ab9d 100644
--- a/gcc/rtl-ssa/accesses.cc
+++ b/gcc/rtl-ssa/accesses.cc
@@ -1239,6 +1239,14 @@ function_info::add_use (use_info *use)
insert_use_before (use, neighbor->value ());
}
+void
+function_info::reparent_use (use_info *use, set_info *new_def)
+{
+ remove_use (use);
+ use->set_def (new_def);
+ add_use (use);
+}
+
// If USE has a known definition, remove USE from that definition's list
// of uses. Also remove if it from the associated splay tree, if any.
void
diff --git a/gcc/rtl-ssa/functions.h b/gcc/rtl-ssa/functions.h
index 8b53b26..d7da977 100644
--- a/gcc/rtl-ssa/functions.h
+++ b/gcc/rtl-ssa/functions.h
@@ -159,6 +159,9 @@ public:
// Like change_insns, but for a single change CHANGE.
void change_insn (insn_change &change);
+ // Given a use USE, re-parent it to get its def from NEW_DEF.
+ void reparent_use (use_info *use, set_info *new_def);
+
// If the changes that have been made to instructions require updates
// to the CFG, perform those updates now. Return true if something changed.
// If it did: