summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-26 02:12:24 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-26 02:12:24 +0000
commiteb50ac5ccc65943ca0b20f469ce3a89464221542 (patch)
treeb8f8ad02643976771bfe6f56d4169c928b6f8d6e /llvm/lib/CodeGen/LiveVariables.cpp
parenta5beaf6958154b9ad6041705decbc10984227a2a (diff)
downloadbcm5719-llvm-eb50ac5ccc65943ca0b20f469ce3a89464221542.tar.gz
bcm5719-llvm-eb50ac5ccc65943ca0b20f469ce3a89464221542.zip
LiveVariables should clear kill / dead markers first. This allows us to remove a hack in the scheduler.
llvm-svn: 99597
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 519990e04a2..ca8ecff8e61 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -556,17 +556,21 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
if (MI->isPHI())
NumOperandsToProcess = 1;
+ // Clear kill and dead markers. LV will recompute them.
SmallVector<unsigned, 4> UseRegs;
SmallVector<unsigned, 4> DefRegs;
for (unsigned i = 0; i != NumOperandsToProcess; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
+ MachineOperand &MO = MI->getOperand(i);
if (!MO.isReg() || MO.getReg() == 0)
continue;
unsigned MOReg = MO.getReg();
- if (MO.isUse())
+ if (MO.isUse()) {
+ MO.setIsKill(false);
UseRegs.push_back(MOReg);
- if (MO.isDef())
+ } else /*MO.isDef()*/ {
+ MO.setIsDead(false);
DefRegs.push_back(MOReg);
+ }
}
// Process all uses.
OpenPOWER on IntegriCloud