diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-05 05:45:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-05 05:45:42 +0000 |
commit | 2ce7f2068f13566f5a70ee779e3bb83a6cb8d942 (patch) | |
tree | 9a38d3f956f0b19e7dbfd89acb758b582c4d75c5 /lib | |
parent | 4c0d95178010c8788129b392ab6a1c62484f1620 (diff) |
Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/PostRASchedulerList.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index eb237efa12..18ee27be20 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -426,7 +426,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // must be due to phi elimination or two addr elimination. If this is // the result of two address elimination, then the vreg is one of the // def-and-use register operand. - if (mi->isRegReDefinedByTwoAddr(interval.reg, MOIdx)) { + if (mi->isRegReDefinedByTwoAddr(MOIdx)) { // If this is a two-address definition, then we have already processed // the live range. The only problem is that we didn't realize there // are actually two values in the live interval. Because of this we diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 5c5ba505b5..2cca6c07b1 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -646,13 +646,14 @@ int MachineInstr::findFirstPredOperandIdx() const { return -1; } -/// isRegReDefinedByTwoAddr - Given the defined register and the operand index, +/// isRegReDefinedByTwoAddr - Given the index of a register def operand, /// check if the register def is a re-definition due to two addr elimination. -bool MachineInstr::isRegReDefinedByTwoAddr(unsigned Reg, unsigned DefIdx) const{ +bool MachineInstr::isRegReDefinedByTwoAddr(unsigned DefIdx) const{ + assert(getOperand(DefIdx).isDef() && "DefIdx is not a def!"); const TargetInstrDesc &TID = getDesc(); for (unsigned i = 0, e = TID.getNumOperands(); i != e; ++i) { const MachineOperand &MO = getOperand(i); - if (MO.isReg() && MO.isUse() && MO.getReg() == Reg && + if (MO.isReg() && MO.isUse() && TID.getOperandConstraint(i, TOI::TIED_TO) == (int)DefIdx) return true; } diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index b19525cbaa..5ee6ed0852 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -478,7 +478,7 @@ bool SchedulePostRATDList::BreakAntiDependencies() { if (Reg == 0) continue; if (!MO.isDef()) continue; // Ignore two-addr defs. - if (MI->isRegReDefinedByTwoAddr(Reg, i)) continue; + if (MI->isRegReDefinedByTwoAddr(i)) continue; DefIndices[Reg] = Count; KillIndices[Reg] = -1; diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 7c3c81e7da..bf4e205616 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -609,7 +609,7 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) { // Check if this is a two address instruction. If so, then // the def does not kill the use. if (last->second.first == I && - I->isRegReDefinedByTwoAddr(MO.getReg(), i)) + I->isRegReDefinedByTwoAddr(i)) continue; MachineOperand& lastUD = |