[WebAssembly] Avoid adding redundant EXPR_STACK uses.

llvm-svn: 255563
This commit is contained in:
Dan Gohman 2015-12-14 22:37:23 +00:00
parent a7d52d8543
commit bcdb4cbfb8

View File

@ -78,9 +78,10 @@ static void ImposeStackOrdering(MachineInstr *MI, MachineRegisterInfo &MRI) {
ImposeStackInputOrdering(MI);
// Also read the opaque EXPR_STACK register.
MI->addOperand(MachineOperand::CreateReg(WebAssembly::EXPR_STACK,
/*isDef=*/false,
/*isImp=*/true));
if (!MI->readsRegister(WebAssembly::EXPR_STACK))
MI->addOperand(MachineOperand::CreateReg(WebAssembly::EXPR_STACK,
/*isDef=*/false,
/*isImp=*/true));
// Also, mark any inputs to this instruction as being consumed by an
// instruction on the expression stack.