diff options
author | Paulo Matos <pmatos@igalia.com> | 2021-07-22 21:11:39 +0200 |
---|---|---|
committer | Paulo Matos <pmatos@igalia.com> | 2021-07-22 22:07:24 +0200 |
commit | 46667a10039b664b953eb70534c27627b35a267d (patch) | |
tree | d8de1c786f43b6a20ed295c55645d12987bb5358 /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp | |
parent | df0066a1c9b9610c58d336bdf353e20a20b7ab3f (diff) | |
download | llvm-46667a10039b664b953eb70534c27627b35a267d.zip llvm-46667a10039b664b953eb70534c27627b35a267d.tar.gz llvm-46667a10039b664b953eb70534c27627b35a267d.tar.bz2 |
[WebAssembly] Implementation of global.get/set for reftypes in LLVM IR
Reland of 31859f896.
This change implements new DAG notes GLOBAL_GET/GLOBAL_SET, and
lowering methods for load and stores of reference types from IR
globals. Once the lowering creates the new nodes, tablegen pattern
matches those and converts them to Wasm global.get/set.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D104797
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp index b412a8f..ec2380a 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp @@ -167,6 +167,10 @@ static wasm::ValType getType(const TargetRegisterClass *RC) { return wasm::ValType::F64; if (RC == &WebAssembly::V128RegClass) return wasm::ValType::V128; + if (RC == &WebAssembly::EXTERNREFRegClass) + return wasm::ValType::EXTERNREF; + if (RC == &WebAssembly::FUNCREFRegClass) + return wasm::ValType::FUNCREF; llvm_unreachable("Unexpected register class"); } |