Index: llvm/lib/CodeGen/TargetInstrInfo.cpp =================================================================== --- llvm/lib/CodeGen/TargetInstrInfo.cpp +++ llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -984,6 +984,11 @@ // same virtual register, though. if (MO.isDef() && Reg != DefReg) return false; + + // Do not bother to try rematerializing an instruction with a killed use, + // the value of the operand will not be available anyway. + if (MO.isKill()) + return false; } // Everything checked out.