summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Thumb2SizeReduction.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-12-17 01:25:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-12-17 01:25:34 +0000
commitb16db8171970f7390895f1e36d5887e6baa9abc3 (patch)
treebae70c619ac30a8dbd151211d2ba74aea2556413 /lib/Target/ARM/Thumb2SizeReduction.cpp
parent2e33944c101f2a08ed1d85e807830f2fc089dd06 (diff)
downloadllvm-b16db8171970f7390895f1e36d5887e6baa9abc3.tar.gz
llvm-b16db8171970f7390895f1e36d5887e6baa9abc3.tar.bz2
llvm-b16db8171970f7390895f1e36d5887e6baa9abc3.tar.xz
Fix a CPSR liveness tracking bug introduced when I converted IT block to bundle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Thumb2SizeReduction.cpp')
-rw-r--r--lib/Target/ARM/Thumb2SizeReduction.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Target/ARM/Thumb2SizeReduction.cpp b/lib/Target/ARM/Thumb2SizeReduction.cpp
index e2062882e2..4abff28f02 100644
--- a/lib/Target/ARM/Thumb2SizeReduction.cpp
+++ b/lib/Target/ARM/Thumb2SizeReduction.cpp
@@ -880,14 +880,17 @@ bool Thumb2SizeReduce::ReduceMBB(MachineBasicBlock &MBB) {
}
ProcessNext:
- if (LiveCPSR &&
- NextMII != E && MI->isInsideBundle() && !NextMII->isInsideBundle() &&
- BundleMI->killsRegister(ARM::CPSR))
+ if (NextMII != E && MI->isInsideBundle() && !NextMII->isInsideBundle()) {
// FIXME: Since post-ra scheduler operates on bundles, the CPSR kill
// marker is only on the BUNDLE instruction. Process the BUNDLE
// instruction as we finish with the bundled instruction to work around
// the inconsistency.
- LiveCPSR = false;
+ if (BundleMI->killsRegister(ARM::CPSR))
+ LiveCPSR = false;
+ MachineOperand *MO = BundleMI->findRegisterDefOperand(ARM::CPSR);
+ if (MO && !MO->isDead())
+ LiveCPSR = true;
+ }
bool DefCPSR = false;
LiveCPSR = UpdateCPSRDef(*MI, LiveCPSR, DefCPSR);