aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index 6ef098d..733312f 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -1175,28 +1175,18 @@ static bool RegistersDefinedFromSameValue(LiveIntervals &li,
if (!MI || CP.isPartial() || CP.isPhys())
return false;
- unsigned Dst = MI->getOperand(0).getReg();
- if (!TargetRegisterInfo::isVirtualRegister(Dst))
+ unsigned A = CP.getDstReg();
+ if (!TargetRegisterInfo::isVirtualRegister(A))
return false;
- unsigned A = CP.getDstReg();
unsigned B = CP.getSrcReg();
-
- if (B == Dst)
- std::swap(A, B);
- assert(Dst == A);
+ if (!TargetRegisterInfo::isVirtualRegister(B))
+ return false;
MachineInstr *OtherMI = li.getInstructionFromIndex(OtherVNI->def);
-
if (!OtherMI)
return false;
- unsigned OtherDst = OtherMI->getOperand(0).getReg();
- if (!TargetRegisterInfo::isVirtualRegister(OtherDst))
- return false;
-
- assert(OtherDst == B);
-
if (MI->isImplicitDef()) {
DupCopies.push_back(MI);
return true;