summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
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
commit903231bc58b27bbd1b74622b013fa277ceaeb16f (patch)
treec7826fcfab1b664863a93dabad20d1b05f33e506 /llvm/lib/Target
parent0adfe7aa2f41d940c2198c98828bdb07c64fd082 (diff)
downloadbcm5719-llvm-903231bc58b27bbd1b74622b013fa277ceaeb16f.tar.gz
bcm5719-llvm-903231bc58b27bbd1b74622b013fa277ceaeb16f.zip
Fix a CPSR liveness tracking bug introduced when I converted IT block to bundle.
llvm-svn: 146805
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/Thumb2SizeReduction.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp b/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
index e2062882e23..4abff28f026 100644
--- a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud