diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2025-02-19 16:10:31 -0800 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2025-03-20 17:09:10 -0700 |
commit | e8a5f747cfa9c79ab7d95ff95d17d3e31afede50 (patch) | |
tree | 2a20836243e954fec33741d2a24a8007d4a49a59 /gcc/iterator-utils.h | |
parent | 47822ef8f1b03ab7124aba694709825a93897994 (diff) | |
download | gcc-e8a5f747cfa9c79ab7d95ff95d17d3e31afede50.zip gcc-e8a5f747cfa9c79ab7d95ff95d17d3e31afede50.tar.gz gcc-e8a5f747cfa9c79ab7d95ff95d17d3e31afede50.tar.bz2 |
combine: Add REG_DEAD notes to the last instruction after a split [PR118914]
So gcc.target/aarch64/rev16_2.c started to fail after r15-268-g9dbff9c05520a7,
the problem is combine now rejects the instruction combine. This happens because
after a different combine which uses a define_split and that define_split creates
a new pseudo register. That new pseudo register is dead after the last instruction
in the stream BUT combine never creates a REG_DEAD for it. So combine thinks it is
still needed after and now with the i2 not changing, combine rejects the combine.
Now combine should be creating a REG_DEAD for the new pseudo registers for the last
instruction of the split. This fixes rev16_2.c and also improves the situtation in
other cases by removing other dead instructions.
Bootstrapped and tested on aarch64-linux-gnu and x86_64-linux-gnu.
gcc/ChangeLog:
PR rtl-optimization/118914
* combine.cc (recog_for_combine): Add old_nregs and new_nregs
argument (defaulting to 0). Update call to recog_for_combine_1.
(combine_split_insns): Add old_nregs and new_nregs arguments,
store the old and new max registers to them.
(try_combine): Update calls to combine_split_insns and
pass old_nregs and new_nregs for the i3 call to recog_for_combine.
(find_split_point): Update call to combine_split_insns; ignoring
the values there.
(recog_for_combine_1): Add old_nregs and new_nregs arguments,
if the insn was recognized (and not to no-op move), add the
REG_DEAD notes to pnotes argument.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/iterator-utils.h')
0 files changed, 0 insertions, 0 deletions