summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-04-26 19:00:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-04-26 19:00:32 +0000
commit910c80851e87fba9f17d26a749c3491da0030779 (patch)
tree7ecfbe87526323061e08510f2d32662cb5634a82 /llvm/lib/CodeGen
parent1d48207f5b9529aea29a5186800179aca365900c (diff)
downloadbcm5719-llvm-910c80851e87fba9f17d26a749c3491da0030779.tar.gz
bcm5719-llvm-910c80851e87fba9f17d26a749c3491da0030779.zip
Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.
llvm-svn: 36483
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp2
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp3
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp4
-rw-r--r--llvm/lib/CodeGen/RegisterScavenging.cpp2
-rw-r--r--llvm/lib/CodeGen/VirtRegMap.cpp10
5 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index e936158f3e1..c542033548d 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -887,7 +887,7 @@ bool LiveIntervals::AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB,
// If the source instruction was killing the source register before the
// merge, unset the isKill marker given the live range has been extended.
- int UIdx = ValLREndInst->findRegisterUseOperand(IntB.reg, true);
+ int UIdx = ValLREndInst->findRegisterUseOperandIdx(IntB.reg, true);
if (UIdx != -1)
ValLREndInst->getOperand(UIdx).unsetIsKill();
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 9c7f13d9b02..4816cc12577 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -435,7 +435,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
"Cannot have a live-in virtual register!");
HandlePhysRegUse(*I, Ret);
// Add live-out registers as implicit uses.
- Ret->addRegOperand(*I, false, true);
+ if (Ret->findRegisterUseOperandIdx(*I) == -1)
+ Ret->addRegOperand(*I, false, true);
}
}
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index a1e76916f1d..1c0d9cc4eb1 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -169,10 +169,10 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
}
}
-/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
+/// findRegisterUseOperandIdx() - Returns the MachineOperand that is a use of
/// the specific register or -1 if it is not found. It further tightening
/// the search criteria to a use that kills the register if isKill is true.
-int MachineInstr::findRegisterUseOperand(unsigned Reg, bool isKill){
+int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill) {
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
MachineOperand &MO = getOperand(i);
if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index 13a36199195..93c63bf1aca 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -235,7 +235,7 @@ static unsigned calcDistanceToUse(MachineBasicBlock *MBB,
I = next(I);
while (I != MBB->end()) {
Dist++;
- if (I->findRegisterUseOperand(Reg) != -1)
+ if (I->findRegisterUseOperandIdx(Reg) != -1)
return Dist;
I = next(I);
}
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index 482e336f871..9ae38ac9013 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -764,7 +764,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
// necessary.
bool WasKill = false;
if (SSMI) {
- int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
+ int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
if (UIdx != -1) {
MachineOperand &MOK = SSMI->getOperand(UIdx);
WasKill = MOK.isKill();
@@ -849,7 +849,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
// necessary.
bool WasKill = false;
if (SSMI) {
- int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
+ int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
if (UIdx != -1) {
MachineOperand &MOK = SSMI->getOperand(UIdx);
WasKill = MOK.isKill();
@@ -859,7 +859,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
MachineInstr *CopyMI = prior(MII);
if (WasKill) {
// Transfer kill to the next use.
- int UIdx = CopyMI->findRegisterUseOperand(PhysReg);
+ int UIdx = CopyMI->findRegisterUseOperandIdx(PhysReg);
assert(UIdx != -1);
MachineOperand &MOU = CopyMI->getOperand(UIdx);
MOU.setIsKill();
@@ -957,7 +957,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
// extended. Remove its kill.
bool WasKill = false;
if (SSMI) {
- int UIdx = SSMI->findRegisterUseOperand(InReg, true);
+ int UIdx = SSMI->findRegisterUseOperandIdx(InReg, true);
if (UIdx != -1) {
MachineOperand &MOK = SSMI->getOperand(UIdx);
WasKill = MOK.isKill();
@@ -967,7 +967,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
if (NextMII != MBB.end()) {
// If NextMII uses InReg and the use is not a two address
// operand, mark it killed.
- int UIdx = NextMII->findRegisterUseOperand(InReg);
+ int UIdx = NextMII->findRegisterUseOperandIdx(InReg);
if (UIdx != -1) {
MachineOperand &MOU = NextMII->getOperand(UIdx);
if (WasKill) {
OpenPOWER on IntegriCloud