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/CodeGen/ValueTypes.cpp | |
| parent | df0066a1c9b9610c58d336bdf353e20a20b7ab3f (diff) | |
[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/CodeGen/ValueTypes.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ValueTypes.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ValueTypes.cpp b/llvm/lib/CodeGen/ValueTypes.cpp index ae0b945bdba8..9daebfd9e63d 100644 --- a/llvm/lib/CodeGen/ValueTypes.cpp +++ b/llvm/lib/CodeGen/ValueTypes.cpp @@ -198,6 +198,10 @@ Type *EVT::getTypeForEVT(LLVMContext &Context) const { case MVT::ppcf128: return Type::getPPC_FP128Ty(Context); case MVT::x86mmx: return Type::getX86_MMXTy(Context); case MVT::x86amx: return Type::getX86_AMXTy(Context); + case MVT::externref: + return PointerType::get(StructType::create(Context), 10); + case MVT::funcref: + return PointerType::get(StructType::create(Context), 20); case MVT::v1i1: return FixedVectorType::get(Type::getInt1Ty(Context), 1); case MVT::v2i1: |
