diff options
author | Andrew Trick <atrick@apple.com> | 2012-01-31 18:54:19 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-01-31 18:54:19 +0000 |
commit | 25c7b83a4bf15a5ef23d4907296dfaaee5bd369f (patch) | |
tree | 580316fcaeaa258fb3aeaaabebeb90f5cf9a7d08 | |
parent | 21ae40e5135aa6bb9a02e3dcc447ba98471c59a3 (diff) | |
download | bcm5719-llvm-25c7b83a4bf15a5ef23d4907296dfaaee5bd369f.tar.gz bcm5719-llvm-25c7b83a4bf15a5ef23d4907296dfaaee5bd369f.zip |
Obvious unnecessary loop removal. Follow through from previous checkin.
llvm-svn: 149398
-rw-r--r-- | llvm/lib/CodeGen/RegAllocFast.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp index ceba05cbbd7..a54785d66f6 100644 --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/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) |