https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113613
Alex Coplan <acoplan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rsandifo at gcc dot gnu.org
Summary|[14 Regression] Missing |[14 Regression] Missing
|ldp/stp optimization |ldp/stp optimization since
|sometimes |r14-6290-g9f0f7d802482a8
--- Comment #4 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Interestingly we started to miss this with the introduction of aarch64
early RA i.e. r14-6290-g9f0f7d802482a8958d6cdc72f1fe0c8549db2182.
My ldp/stp pattern rewrite was:
r14-6604-gd7ee988c491cde43d04fe25f2b3dbad9d85ded45
so we started to miss this before any of my ldp/stp patches.
Looking at what happens with the ldp/stp pass, I can see that in sched1 we've
already allocated hard regs to the vector load destinations:
3: NOTE_INSN_BASIC_BLOCK 2
2: NOTE_INSN_FUNCTION_BEG
13: NOTE_INSN_DELETED
5: debug begin stmt marker
6: r107:DI=high(`*.LANCHOR0')
7: r106:DI=r107:DI+low(`*.LANCHOR0')
REG_EQUAL `*.LANCHOR0'
14: v31:V2SF=[r107:DI+low(`*.LANCHOR0')]
15: v30:V2SF=[r106:DI+0x20]
16: v30:V2SF=v31:V2SF+v30:V2SF
REG_DEAD v31:V2SF
27: v31:V2SF=[r106:DI+0x8]
17: [r107:DI+low(`*.LANCHOR0')]=v30:V2SF
REG_DEAD r107:DI
REG_DEAD v30:V2SF
18: debug begin stmt marker
28: v30:V2SF=[r106:DI+0x28]
29: v30:V2SF=v31:V2SF+v30:V2SF
REG_DEAD v31:V2SF
30: [r106:DI+0x8]=v30:V2SF
REG_DEAD r106:DI
REG_DEAD v30:V2SF
33: NOTE_INSN_DELETED
and then there's nothing that the early ldp/stp pass can do because the
would-be load pair candidates already use the same (hard) transfer register due
to early RA:
merge_pairs [L=1], cand vecs (14) x (27)
analyzing pair (load=1): (14,27)
punting on ldp due to reg conflcits (14,27)
merge_pairs [L=1], cand vecs (15) x (28)
analyzing pair (load=1): (15,28)
punting on ldp due to reg conflcits (15,28)
merge_pairs [L=0], cand vecs (17) x (30)
analyzing pair (load=0): (17,30)
pair (17,30): rejecting base 106 due to dataflow hazards (28,29)
can't form pair (17,30) due to dataflow hazards
starting the processing of deferred insns
ending the processing of deferred insns
CCing Richard S for an opinion.