git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255563
91177308-0d34-0410-b5e6-
96231b3b80d8
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.