Don't depend on kill flags in removeCopyByCommutingDef().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 15 Sep 2012 16:32:11 +0000 (16:32 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 15 Sep 2012 16:32:11 +0000 (16:32 +0000)
Kill flags are removed more and more aggressively during the register
allocation passes, it is better to get information from LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163972 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterCoalescer.cpp

index d01883545632d69a5092cdb8a5945978c1e96e3d..f8165d3fe08611a6a2581373b08dd989c385c4df 100644 (file)
@@ -583,7 +583,7 @@ bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP,
 
   MachineOperand &NewDstMO = DefMI->getOperand(NewDstIdx);
   unsigned NewReg = NewDstMO.getReg();
-  if (NewReg != IntB.reg || !NewDstMO.isKill())
+  if (NewReg != IntB.reg || !LiveRangeQuery(IntB, AValNo->def).isKill())
     return false;
 
   // Make sure there are no other definitions of IntB that would reach the