Index: lib/CodeGen/MachineInstr.cpp =================================================================== --- lib/CodeGen/MachineInstr.cpp +++ lib/CodeGen/MachineInstr.cpp @@ -1760,7 +1760,8 @@ // Trim unneeded kill operands. while (!DeadOps.empty()) { unsigned OpIdx = DeadOps.back(); - if (getOperand(OpIdx).isImplicit()) + if (getOperand(OpIdx).isImplicit() && + (!isInlineAsm() || findInlineAsmFlagIdx(OpIdx) < 0)) RemoveOperand(OpIdx); else getOperand(OpIdx).setIsKill(false); @@ -1824,7 +1825,8 @@ // Trim unneeded dead operands. while (!DeadOps.empty()) { unsigned OpIdx = DeadOps.back(); - if (getOperand(OpIdx).isImplicit()) + if (getOperand(OpIdx).isImplicit() && + (!isInlineAsm() || findInlineAsmFlagIdx(OpIdx) < 0)) RemoveOperand(OpIdx); else getOperand(OpIdx).setIsDead(false);