summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-05 00:59:57 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-05 00:59:57 +0000
commit6325446666b4c76f399b3974f8ef1b5092624e2a (patch)
treed1ccfe11959e609c91d777fb9903a8709c7ae9ad /llvm/lib/CodeGen/VirtRegMap.cpp
parentf9c67f60560a1e63f2741b6c3ed8a093d0f79325 (diff)
downloadbcm5719-llvm-6325446666b4c76f399b3974f8ef1b5092624e2a.tar.gz
bcm5719-llvm-6325446666b4c76f399b3974f8ef1b5092624e2a.zip
Refactor code. Remove duplicated functions that basically do the same thing as
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. llvm-svn: 47927
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--llvm/lib/CodeGen/VirtRegMap.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index 6cfbee9b7b7..c39ac610e96 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/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];
OpenPOWER on IntegriCloud