summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-01-31 18:54:19 +0000
committerAndrew Trick <atrick@apple.com>2012-01-31 18:54:19 +0000
commitab78e20ce085763b4fc9948eaa715fb7e49341c8 (patch)
tree69cda252adbbaad1f2e57a21dca6b448ba400d15 /lib/CodeGen/RegAllocFast.cpp
parent0db58bfecea020ffcdfa1fc6458995371e1c3c50 (diff)
downloadllvm-ab78e20ce085763b4fc9948eaa715fb7e49341c8.tar.gz
llvm-ab78e20ce085763b4fc9948eaa715fb7e49341c8.tar.bz2
llvm-ab78e20ce085763b4fc9948eaa715fb7e49341c8.tar.xz
Obvious unnecessary loop removal. Follow through from previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index ceba05cbbd..a54785d66f 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -775,17 +775,16 @@ void RAFast::addRetOperands(MachineBasicBlock *MBB) {
continue;
unsigned OperReg = MO.getReg();
- for (const unsigned *AS = TRI->getOverlaps(Reg); *AS; ++AS) {
- if (OperReg != *AS)
- continue;
- if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
- // If the ret already has an operand for this physreg or a superset,
- // don't duplicate it. Set the kill flag if the value is defined.
- if (hasDef && !MO.isKill())
- MO.setIsKill();
- Found = true;
- break;
- }
+ if (!TargetRegisterInfo::isPhysicalRegister(OperReg))
+ continue;
+
+ if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
+ // If the ret already has an operand for this physreg or a superset,
+ // don't duplicate it. Set the kill flag if the value is defined.
+ if (hasDef && !MO.isKill())
+ MO.setIsKill();
+ Found = true;
+ break;
}
}
if (!Found)