]> gcc.gnu.org Git - gcc.git/commit
rtl-ssa: Support for inserting new insns
authorAlex Coplan <alex.coplan@arm.com>
Sat, 16 Sep 2023 08:23:52 +0000 (09:23 +0100)
committerAlex Coplan <alex.coplan@arm.com>
Fri, 24 Nov 2023 10:57:51 +0000 (10:57 +0000)
commita49befbd2c783e751dc2110b544fe540eb7e33eb
tree40f8c2ce0f164a247811413dd1019a89e17b9b68
parenteebcad0ac22010fc59de9d856bb02017fccab282
rtl-ssa: Support for inserting new insns

The upcoming aarch64 load pair pass needs to form store pairs, and can
re-order stores over loads when alias analysis determines this is safe.
In the case that both mem defs have uses in the RTL-SSA IR, and both
stores require re-ordering over their uses, we represent that as
(tentative) deletion of the original store insns and creation of a new
insn, to prevent requiring repeated re-parenting of uses during the
pass.  We then update all mem uses that require re-parenting in one go
at the end of the pass.

To support this, RTL-SSA needs to handle inserting new insns (rather
than just changing existing ones), so this patch adds support for that.

New insns (and new accesses) are temporaries, allocated above a temporary
obstack_watermark, such that the user can easily back out of a change without
awkward bookkeeping.

gcc/ChangeLog:

* rtl-ssa/accesses.cc (function_info::create_set): New.
* rtl-ssa/accesses.h (access_info::is_temporary): New.
* rtl-ssa/changes.cc (move_insn): Handle new (temporary) insns.
(function_info::finalize_new_accesses): Handle new/temporary
user-created accesses.
(function_info::apply_changes_to_insn): Ensure m_is_temp flag
on new insns gets cleared.
(function_info::change_insns): Handle new/temporary insns.
(function_info::create_insn): New.
* rtl-ssa/changes.h (class insn_change): Make function_info a
friend class.
* rtl-ssa/functions.h (function_info): Declare new entry points:
create_set, create_insn.  Declare new change_alloc helper.
* rtl-ssa/insns.cc (insn_info::print_full): Identify temporary insns in
dump.
* rtl-ssa/insns.h (insn_info): Add new m_is_temp flag and accompanying
is_temporary accessor.
* rtl-ssa/internals.inl (insn_info::insn_info): Initialize m_is_temp to
false.
* rtl-ssa/member-fns.inl (function_info::change_alloc): New.
* rtl-ssa/movement.h (restrict_movement_for_defs_ignoring): Add
handling for temporary defs.
gcc/rtl-ssa/accesses.cc
gcc/rtl-ssa/accesses.h
gcc/rtl-ssa/changes.cc
gcc/rtl-ssa/changes.h
gcc/rtl-ssa/functions.h
gcc/rtl-ssa/insns.cc
gcc/rtl-ssa/insns.h
gcc/rtl-ssa/internals.inl
gcc/rtl-ssa/member-fns.inl
gcc/rtl-ssa/movement.h
This page took 0.061423 seconds and 5 git commands to generate.