diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp index 7746316..cb7bcf3 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -316,6 +316,9 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { if (MO.isDef()) { assert(MI.getOpcode() == TargetOpcode::INLINEASM); unsigned LocalId = getLocalId(Reg2Local, CurLocal, OldReg); + // If this register operand is tied to another operand, we can't + // change it to an immediate. Untie it first. + MI.untieRegOperand(MI.getOperandNo(&MO)); MO.ChangeToImmediate(LocalId); continue; } @@ -331,6 +334,8 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { // indices as immediates. if (MI.getOpcode() == TargetOpcode::INLINEASM) { unsigned LocalId = getLocalId(Reg2Local, CurLocal, OldReg); + // Untie it first if this reg operand is tied to another operand. + MI.untieRegOperand(MI.getOperandNo(&MO)); MO.ChangeToImmediate(LocalId); continue; } |