aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-20 06:46:46 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-20 06:46:46 +0000
commit6cf93d740a600024f2de924614a4d4d0dc1cb852 (patch)
treeee875794d4d0f38e71beb125799a74e926681e72
parent60af0f25616d8f228f1c5aa6ad79426fcc46baaa (diff)
downloadexternal_llvm-6cf93d740a600024f2de924614a4d4d0dc1cb852.zip
external_llvm-6cf93d740a600024f2de924614a4d4d0dc1cb852.tar.gz
external_llvm-6cf93d740a600024f2de924614a4d4d0dc1cb852.tar.bz2
Move the computation of the IsEarlyClobber flag into its own loop, since the
correct value is needed in every iteration of the loop for updating LiveIntervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175603 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index f5d41c7..cf14b4d 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1215,6 +1215,11 @@ TwoAddressInstructionPass::processTiedPairs(MachineInstr *MI,
TiedPairList &TiedPairs,
unsigned &Dist) {
bool IsEarlyClobber = false;
+ for (unsigned tpi = 0, tpe = TiedPairs.size(); tpi != tpe; ++tpi) {
+ const MachineOperand &DstMO = MI->getOperand(TiedPairs[tpi].second);
+ IsEarlyClobber |= DstMO.isEarlyClobber();
+ }
+
bool RemovedKillFlag = false;
bool AllUsesCopied = true;
unsigned LastCopiedReg = 0;
@@ -1225,7 +1230,6 @@ TwoAddressInstructionPass::processTiedPairs(MachineInstr *MI,
const MachineOperand &DstMO = MI->getOperand(DstIdx);
unsigned RegA = DstMO.getReg();
- IsEarlyClobber |= DstMO.isEarlyClobber();
// Grab RegB from the instruction because it may have changed if the
// instruction was commuted.