diff options
| author | Sam Parker <sam.parker@arm.com> | 2020-01-09 08:33:47 +0000 |
|---|---|---|
| committer | Sam Parker <sam.parker@arm.com> | 2020-01-09 08:33:47 +0000 |
| commit | e93e0d413f3afa1df5c5f88df546bebcd1183155 (patch) | |
| tree | 755777ed531f0de1c70783b622d3c577f9fb53d3 /llvm/lib/CodeGen | |
| parent | 2d515e49d89c0738ccef8f1733d5f9afe00ee979 (diff) | |
| download | bcm5719-llvm-e93e0d413f3afa1df5c5f88df546bebcd1183155.tar.gz bcm5719-llvm-e93e0d413f3afa1df5c5f88df546bebcd1183155.zip | |
[ARM][LowOverheadLoops] Update liveness info
After expanding the pseudo instructions, update the liveness info.
We do this in a post-order traversal of the loop, including its
exit blocks and preheader(s).
Differential Revision: https://reviews.llvm.org/D72131
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/LivePhysRegs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LivePhysRegs.cpp b/llvm/lib/CodeGen/LivePhysRegs.cpp index 7a5cffca347..547970e7ab5 100644 --- a/llvm/lib/CodeGen/LivePhysRegs.cpp +++ b/llvm/lib/CodeGen/LivePhysRegs.cpp @@ -276,6 +276,7 @@ void llvm::recomputeLivenessFlags(MachineBasicBlock &MBB) { const MachineFunction &MF = *MBB.getParent(); const MachineRegisterInfo &MRI = MF.getRegInfo(); const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo(); + const MachineFrameInfo &MFI = MF.getFrameInfo(); // We walk through the block backwards and start with the live outs. LivePhysRegs LiveRegs; @@ -294,6 +295,18 @@ void llvm::recomputeLivenessFlags(MachineBasicBlock &MBB) { assert(Register::isPhysicalRegister(Reg)); bool IsNotLive = LiveRegs.available(MRI, Reg); + + // Special-case return instructions for cases when a return is not + // the last instruction in the block. + if (MI.isReturn() && MFI.isCalleeSavedInfoValid()) { + for (const CalleeSavedInfo &Info : MFI.getCalleeSavedInfo()) { + if (Info.getReg() == Reg) { + IsNotLive = !Info.isRestored(); + break; + } + } + } + MO->setIsDead(IsNotLive); } |

