summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)