Ensure that we're recording implicit defs, as well as visiting implicit uses and implicit defs when we're walking through operands. This requires a change to ARMLowOverheadLoops because RDA now knows that t2LoopEnd is set to define the CPSR.
Details
Diff Detail
Event Timeline
llvm/lib/CodeGen/ReachingDefAnalysis.cpp | ||
---|---|---|
129 | I am thinking if it is time for a MO helper function that tests this, because I see a lot of the same/similar checks: if (!MO.isReg() || !MO.isUse() || MO.getReg() != PhysReg) Perhaps a local static helper function(s) is easiest to increase readability? |
Thanks for that! That greatly helps readability!
Where in this patch stack do we expect test changes?
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | ||
---|---|---|
820 | Do we need to start looking again for t2LoopEnd? Is that not saved to End, do we have access to that? |
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | ||
---|---|---|
820 | We still need this because t2LoopEnd isn't actually the last instruction, there's almost certainly an unconditional branch as the terminator, so this code was originally not doing what is was supposed to! Now that we're correctly tracking implicit-defs, RDA will pick up that !isSafeToDefRegAt because t2LoopEnd has an implicit CPSR def and we definitely want to ignore it. |
I am thinking if it is time for a MO helper function that tests this, because I see a lot of the same/similar checks:
if (!MO.isReg() || !MO.isUse() || MO.getReg() != PhysReg)
if (!MO.isReg() || !MO.isUse() || MO.getReg() != PhysReg)
if (MO.isReg() && MO.isDef() && MO.getReg() == PhysReg)
if (MO.isReg() && MO.isDef() && MO.getReg() == PhysReg)
if (!MO.isReg() || MO.isUndef() || !MO.getReg())
if (MO.isReg() && MO.getReg() && Defs.count(MO.getReg()))
if (!MO.isReg() || MO.isUse() || MO.getReg() == 0)
if (!MO.isReg() || MO.getReg() == 0 || !MO.isKill())
if (MO.isReg() && MO.isDef() && MO.getReg() == PhysReg)
Perhaps a local static helper function(s) is easiest to increase readability?