[PATCH] D59447: [WebAssembly] Add immarg attribute to intrinsics
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 16 00:46:58 PDT 2019
aheejin created this revision.
aheejin added reviewers: dschuff, tlively.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, sbc100.
Herald added a project: LLVM.
After D57825 <https://reviews.llvm.org/D57825> (r355981), intrinsic arguments that are immediate values
should be marked as `ImmArg`.
Repository:
rL LLVM
https://reviews.llvm.org/D59447
Files:
include/llvm/IR/IntrinsicsWebAssembly.td
test/CodeGen/WebAssembly/wasmehprepare.ll
Index: test/CodeGen/WebAssembly/wasmehprepare.ll
===================================================================
--- test/CodeGen/WebAssembly/wasmehprepare.ll
+++ test/CodeGen/WebAssembly/wasmehprepare.ll
@@ -405,6 +405,6 @@
declare void @__cxa_end_catch()
declare void @__clang_call_terminate(i8*)
-; CHECK-DAG: declare void @llvm.wasm.landingpad.index(token, i32)
+; CHECK-DAG: declare void @llvm.wasm.landingpad.index(token, i32 immarg)
; CHECK-DAG: declare i8* @llvm.wasm.lsda()
; CHECK-DAG: declare i32 @_Unwind_CallPersonality(i8*)
Index: include/llvm/IR/IntrinsicsWebAssembly.td
===================================================================
--- include/llvm/IR/IntrinsicsWebAssembly.td
+++ include/llvm/IR/IntrinsicsWebAssembly.td
@@ -40,7 +40,7 @@
// throw / rethrow
def int_wasm_throw : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty],
- [Throws, IntrNoReturn]>;
+ [Throws, IntrNoReturn, ImmArg<0>]>;
def int_wasm_rethrow_in_catch : Intrinsic<[], [], [Throws, IntrNoReturn]>;
// Since wasm does not use landingpad instructions, these instructions return
@@ -58,7 +58,7 @@
// by WasmEHPrepare pass to generate landingpad table in EHStreamer. This is
// used in order to give them the indices in WasmEHPrepare.
def int_wasm_landingpad_index: Intrinsic<[], [llvm_token_ty, llvm_i32_ty],
- [IntrNoMem]>;
+ [IntrNoMem, ImmArg<1>]>;
// Returns LSDA address of the current function.
def int_wasm_lsda : Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>;
@@ -118,10 +118,10 @@
Intrinsic<[],
[llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
[IntrWriteMem, IntrInaccessibleMemOrArgMemOnly, WriteOnly<2>,
- IntrHasSideEffects]>;
+ IntrHasSideEffects, ImmArg<0>, ImmArg<1>]>;
def int_wasm_data_drop :
Intrinsic<[],
[llvm_i32_ty],
- [IntrNoDuplicate, IntrHasSideEffects]>;
+ [IntrNoDuplicate, IntrHasSideEffects, ImmArg<0>]>;
} // TargetPrefix = "wasm"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59447.190948.patch
Type: text/x-patch
Size: 2118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190316/5ec72000/attachment.bin>
More information about the llvm-commits
mailing list