diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-05-18 13:00:47 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-06-01 14:23:26 -0700 |
commit | a743a72714fc4a9d7036d28d0cacdf2a3621f629 (patch) | |
tree | 4a2da93e3ac20ae6f5be420e5792cc84a6f2f3ad /gcc/ada | |
parent | e2e471d83d16449a325315c0f33dc52b90ce0fac (diff) | |
download | gcc-a743a72714fc4a9d7036d28d0cacdf2a3621f629.zip gcc-a743a72714fc4a9d7036d28d0cacdf2a3621f629.tar.gz gcc-a743a72714fc4a9d7036d28d0cacdf2a3621f629.tar.bz2 |
DSE: Use the constant store source if possible
RTL DSE tracks redundant constant stores within a basic block. When RTL
loop invariant motion hoists a constant initialization out of the loop
into a separate basic block, the constant store value becomes unknown
within the original basic block. When recording store for RTL DSE, check
if the source register is set only once to a constant by a non-partial
unconditional load. If yes, record the constant as the constant store
source. It eliminates unrolled zero stores after memset 0 in a loop
where a vector register is used as the zero store source.
gcc/
PR rtl-optimization/105638
* df-core.cc (df_find_single_def_src): Moved and renamed from
find_single_def_src in loop-iv.cc. Change the argument to rtx
and use rtx_equal_p. Return null for partial or conditional
defs.
* df.h (df_find_single_def_src): New prototype.
* dse.cc (record_store): Use the constant source if the source
register is set only once.
* loop-iv.cc (find_single_def_src): Moved to df-core.cc.
(replace_single_def_regs): Replace find_single_def_src with
df_find_single_def_src.
gcc/testsuite/
PR rtl-optimization/105638
* g++.target/i386/pr105638.C: New test.
Diffstat (limited to 'gcc/ada')
0 files changed, 0 insertions, 0 deletions