diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2024-07-24 11:16:26 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-07-24 11:16:26 -0600 |
commit | 679086172b84be18c55fdbb9cda7e97806e7c083 (patch) | |
tree | d2b9774ad935bbd7454cdb96bf3b0086413adcca /gcc/analyzer/program-state.cc | |
parent | 69e69847e21a8d951ab5f09fd3421449564dba31 (diff) | |
download | gcc-679086172b84be18c55fdbb9cda7e97806e7c083.zip gcc-679086172b84be18c55fdbb9cda7e97806e7c083.tar.gz gcc-679086172b84be18c55fdbb9cda7e97806e7c083.tar.bz2 |
[rtl-optimization/116037] Explicitly track if a destination was skipped in ext-dce
So this has been in the hopper since the first bugs were reported against
ext-dce. It'd been holding off committing as I was finding other issues in
terms of correctness of live computations. There's still problems in that
space, but I think it's time to push this chunk forward. I'm marking it as
116037, but it may impact other bugs.
This patch starts explicitly tracking if set processing skipped a destination,
which can happen for wide modes (TI+), vectors, certain subregs, etc. This is
computed during ext_dce_set_processing.
During use processing we use that flag to determine reliably if we need to make
the inputs fully live and to avoid even trying to eliminate an extension if we
skipped output processing.
While testing this I found that a recent change to fix cases where we had two
subreg input operands mucked up the code to make things like a shift/rotate
count fully live. So that goof has been fixed.
Bootstrapped and regression tested on x86. Most, but not all, of these changes
have also been tested on the crosses. Pushing to the trunk.
I'm not including it in this patch but I'm poking at converting this code to
use note_uses/note_stores to make it more maintainable. The SUBREG and
STRICT_LOW_PART handling of note_stores is problematical, but I think it's
solvable. I haven't tried a conversion to note_uses yet.
PR rtl-optimization/116037
gcc/
* ext-dce.cc (ext_dce_process_sets): Note if we ever skip a dest
and return that info explicitly.
(ext_dce_process_uses): If a set was skipped, then consider all bits
in every input as live. Do not try to optimize away an extension if
we skipped processing a destination in the same insn. Restore code
to make shift/rotate count fully live.
(ext_dce_process_bb): Handle API changes for ext_dce_process_sets.
gcc/testsuite/
* gcc.dg/torture/pr116037.c: New test
Diffstat (limited to 'gcc/analyzer/program-state.cc')
0 files changed, 0 insertions, 0 deletions