diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-03-05 00:59:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-03-05 00:59:57 +0000 |
commit | 6130f66eaae89f8878590796977678afa8448926 (patch) | |
tree | 9e0d41836f9fcae91af847f9483fcc3cb0ca780c /lib/CodeGen/VirtRegMap.cpp | |
parent | 4d519457d1ee72d14d62a5823b03449dc0e3df6e (diff) |
Refactor code. Remove duplicated functions that basically do the same thing as
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 6cfbee9b7b..c39ac610e9 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -862,8 +862,7 @@ bool LocalSpiller::PrepForUnfoldOpti(MachineBasicBlock &MBB, MachineInstr* DeadStore = MaybeDeadStores[FoldedSS]; if (DeadStore && (MR & VirtRegMap::isModRef)) { unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(FoldedSS); - if (!PhysReg || - DeadStore->findRegisterUseOperandIdx(PhysReg, true) == -1) + if (!PhysReg || !DeadStore->readsRegister(PhysReg)) continue; UnfoldPR = PhysReg; UnfoldedOpc = TII->getOpcodeAfterMemoryUnfold(MI.getOpcode(), @@ -908,7 +907,7 @@ bool LocalSpiller::PrepForUnfoldOpti(MachineBasicBlock &MBB, assert(NewMIs.size() == 1); MachineInstr *NewMI = NewMIs.back(); NewMIs.clear(); - int Idx = NewMI->findRegisterUseOperandIdx(VirtReg); + int Idx = NewMI->findRegisterUseOperandIdx(VirtReg, false); assert(Idx != -1); SmallVector<unsigned, 2> Ops; Ops.push_back(Idx); @@ -1410,7 +1409,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) { // the physreg. if (PhysReg && !TII->isStoreToStackSlot(&MI, SS) && // Not profitable! - DeadStore->findRegisterUseOperandIdx(PhysReg, true) != -1 && + DeadStore->killsRegister(PhysReg) && TII->unfoldMemoryOperand(MF, &MI, PhysReg, false, true, NewMIs)) { MBB.insert(MII, NewMIs[0]); NewStore = NewMIs[1]; |