diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td index f761606f2e8..60e5d6ea645 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -107,15 +107,8 @@ defm : ARGUMENT<F64>; let Defs = [ARGUMENTS] in { // get_local and set_local are not generated by instruction selection; they -// are implied by virtual register uses and defs in most contexts. However, -// they are explicitly emitted for special purposes. +// are implied by virtual register uses and defs. multiclass LOCAL<WebAssemblyRegClass vt> { - def GET_LOCAL_#vt : I<(outs vt:$res), (ins i32imm:$regno), [], - "get_local\t$res, $regno">; - // TODO: set_local returns its operand value - def SET_LOCAL_#vt : I<(outs), (ins i32imm:$regno, vt:$src), [], - "set_local\t$regno, $src">; - // COPY_LOCAL is not an actual instruction in wasm, but since we allow // get_local and set_local to be implicit, we can have a COPY_LOCAL which // is actually a no-op because all the work is done in the implied @@ -123,6 +116,13 @@ multiclass LOCAL<WebAssemblyRegClass vt> { let isAsCheapAsAMove = 1 in def COPY_LOCAL_#vt : I<(outs vt:$res), (ins vt:$src), [], "copy_local\t$res, $src">; + + // TEE_LOCAL is similar to COPY_LOCAL, but writes two copies of its result. + // Typically this would be used to stackify one result and write the other + // result to a local. + let isAsCheapAsAMove = 1 in + def TEE_LOCAL_#vt : I<(outs vt:$res, vt:$also), (ins vt:$src), [], + "tee_local\t$res, $also, $src">; } defm : LOCAL<I32>; defm : LOCAL<I64>; |

