[MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands from...
authorCraig Topper <craig.topper@intel.com>
Thu, 13 Sep 2018 20:51:27 +0000 (20:51 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 13 Sep 2018 20:51:27 +0000 (20:51 +0000)
commit2f88006cedd06b8e2be1e9d282ba7e3bf88f57ca
treebef5cc32a8576e5953a232463741b800dd7a7371
parent59ad1c845787238560142d7608bc9433cbe9eaa0
[MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands from inline assembly instructions if they have an associated flag operand.

INLINEASM instructions use extra operands to carry flags. If a register operand is removed without removing the flag operand, then the flags will no longer make sense.

This patch fixes this by preventing the removal when a flag operand is present.

The included test case was generated by MS inline assembly. Longer term maybe we should fix the inline assembly parsing to not generate redundant operands.

Differential Revision: https://reviews.llvm.org/D51829

llvm-svn: 342176
llvm/lib/CodeGen/MachineInstr.cpp
llvm/test/CodeGen/X86/ms-inline-asm-redundant-clobber.ll [new file with mode: 0644]