diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2018-01-26 20:23:00 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2018-01-26 20:23:00 +0000 |
commit | 29108843ff2f80e943bc89eeafb0118ccbbc14cc (patch) | |
tree | 5b2d4845e1e0a6b09e9490d6d16ad971101ee96d /llvm/lib/CodeGen/LivePhysRegs.cpp | |
parent | d15b2898d3390137497b0813dc8ccbf80cd06055 (diff) | |
download | bcm5719-llvm-29108843ff2f80e943bc89eeafb0118ccbbc14cc.tar.gz bcm5719-llvm-29108843ff2f80e943bc89eeafb0118ccbbc14cc.zip |
[LivePhysRegs] Preserve pristine regs in blocks with no successors.
One common source of blocks with no successors is calls to noreturn
functions; we want to preserve pristine registers in case they throw an
exception.
The whole pristine register thing is messy (we should really prefer to
explicitly model registers), but this fills a hole in the model for now.
Fixes https://bugs.llvm.org/show_bug.cgi?id=36073.
Differential Revision: https://reviews.llvm.org/D42509
llvm-svn: 323559
Diffstat (limited to 'llvm/lib/CodeGen/LivePhysRegs.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LivePhysRegs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LivePhysRegs.cpp b/llvm/lib/CodeGen/LivePhysRegs.cpp index f4b43a9b8ea..c07fa16e129 100644 --- a/llvm/lib/CodeGen/LivePhysRegs.cpp +++ b/llvm/lib/CodeGen/LivePhysRegs.cpp @@ -225,10 +225,10 @@ void LivePhysRegs::addLiveOutsNoPristines(const MachineBasicBlock &MBB) { void LivePhysRegs::addLiveOuts(const MachineBasicBlock &MBB) { const MachineFunction &MF = *MBB.getParent(); - if (!MBB.succ_empty()) { + if (!MBB.isReturnBlock()) { addPristines(MF); addLiveOutsNoPristines(MBB); - } else if (MBB.isReturnBlock()) { + } else { // For the return block: Add all callee saved registers. const MachineFrameInfo &MFI = MF.getFrameInfo(); if (MFI.isCalleeSavedInfoValid()) |