It is safe to remat a value killed by phis.
[oota-llvm.git] / lib / CodeGen / RegisterCoalescer.cpp
index f3b8ae33c6ae28376c661683b75cd0809c4e989a..674d075c4f88e4c19768f5fd166387ffcbbb6ca6 100644 (file)
@@ -805,9 +805,7 @@ bool RegisterCoalescer::ReMaterializeTrivialDef(LiveInterval &SrcInt,
   LiveInterval::iterator SrcLR = SrcInt.FindLiveRangeContaining(CopyIdx);
   assert(SrcLR != SrcInt.end() && "Live range not found!");
   VNInfo *ValNo = SrcLR->valno;
-  // If other defs can reach uses of this def, then it's not safe to perform
-  // the optimization.
-  if (ValNo->isPHIDef() || ValNo->isUnused() || ValNo->hasPHIKill())
+  if (ValNo->isPHIDef() || ValNo->isUnused())
     return false;
   MachineInstr *DefMI = LIS->getInstructionFromIndex(ValNo->def);
   if (!DefMI)