CodeGen: ignore DEBUG_VALUE nodes in KILL tagging
[oota-llvm.git] / lib / CodeGen / ScheduleDAGInstrs.cpp
index 583ed38f313ebdfd917352481c7481626ac4b007..b4a34be759c836048113b40e203cb04769eb0083 100644 (file)
@@ -1115,6 +1115,12 @@ static void toggleBundleKillFlag(MachineInstr *MI, unsigned Reg,
       if (!MO->isReg() || MO->isDef() || Reg != MO->getReg())
         continue;
 
+      // DEBUG_VALUE nodes do not contribute to code generation and should
+      // always be ignored.  Failure to do so may result in trying to modify
+      // KILL flags on DEBUG_VALUE nodes, which is distressing.
+      if (MO->isDebug())
+        continue;
+
       // If the register has the internal flag then it could be killing an
       // internal def of the register.  In this case, just skip.  We only want
       // to toggle the flag on operands visible outside the bundle.