summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-23 23:13:28 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-23 23:13:28 +0000
commite6907bc0e6ab9dcd11eccdd14fcc1168a815b98c (patch)
treeeb70efe65a26d0eb39d1a0448f166df2a093a990
parentcd8599e8c9774b83160ac1957e139838bf2bed64 (diff)
downloadbcm5719-llvm-e6907bc0e6ab9dcd11eccdd14fcc1168a815b98c.tar.gz
bcm5719-llvm-e6907bc0e6ab9dcd11eccdd14fcc1168a815b98c.zip
TargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
unless it was requested to with an optional parameter that defaults to false, so we don't need to handle that case in TwoAddressInstructionPass. llvm-svn: 175974
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index aca85b2aa17..2ed6be4f009 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -581,19 +581,9 @@ commuteInstruction(MachineBasicBlock::iterator &mi,
}
DEBUG(dbgs() << "2addr: COMMUTED TO: " << *NewMI);
- // If the instruction changed to commute it, update livevar.
- if (NewMI != MI) {
- if (LV)
- // Update live variables
- LV->replaceKillInstruction(RegC, MI, NewMI);
- if (LIS)
- LIS->ReplaceMachineInstrInMaps(MI, NewMI);
-
- MBB->insert(mi, NewMI); // Insert the new inst
- MBB->erase(mi); // Nuke the old inst.
- mi = NewMI;
- DistanceMap.insert(std::make_pair(NewMI, Dist));
- }
+ assert(NewMI == MI &&
+ "TargetInstrInfo::commuteInstruction() should not return a new "
+ "instruction unless it was requested.");
// Update source register map.
unsigned FromRegC = getMappedReg(RegC, SrcRegMap);
OpenPOWER on IntegriCloud