diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2025-07-30 16:44:56 -0700 |
---|---|---|
committer | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-08-11 08:39:57 -0700 |
commit | 127c05f4933365a6baf46f6732b5a2d0adb5562c (patch) | |
tree | d9aa8d2f1844653a87b64176d18f9d7b90957e10 /gcc/testsuite/gcc.dg/torture/pr67741.c | |
parent | f82227cc36a5abbe1926248780bb344327a15485 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
While looking into the gimple level after optimization of the highway code
from google, I noticed in .optimized we still have:
```
MEM <vector(8) short int> [(short int *)&a] = { 0, 0, 0, 0, 0, 0, 0, 0 };
D.4398 = a;
a ={v} {CLOBBER(eos)};
D.4389 = D.4398;
D.4390 = D.4389;
D.4361 = D.4390;
D.4195 = D.4361;
return D.4195;
```
Note this is with SRA disabled since I noticed there is better code generation with
SRA disabled but that is a different story and I will get to that later on.
Which could be just optimized to a single store of `{}` .
The reason why the optimize_agr_copyprop does not handle the above is there was clobbers
inbetween the store in the last forwprop pass and currently don't copy after the first use.
While optimize_aggr_zeroprop does handle copying over clobbers just fine.
So this allows the recognization of the store to a to be like a memset to optimize_aggr_zeroprop
and then the result just falls through.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-forwprop.cc (optimize_aggr_zeroprop): Recognize stores
of integer_zerop as memset of 0.
gcc/testsuite/ChangeLog:
* gcc.dg/torture/copy-prop-aggr-zero-1.c: New test.
* gcc.dg/torture/copy-prop-aggr-zero-2.c: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-zero-1.c: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-zero-2.c: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-zero-3.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr67741.c')
0 files changed, 0 insertions, 0 deletions