From: Heejin Ahn Date: Tue, 19 Mar 2019 05:02:30 +0000 (+0000) Subject: [WebAssembly] Add immarg attribute to intrinsics X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8dd4b7739218947822afa00dc63d4c3effb68e8f;p=llvm [WebAssembly] Add immarg attribute to intrinsics Summary: After r355981, intrinsic arguments that are immediate values should be marked as `ImmArg`. Reviewers: dschuff, tlively Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59447 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356437 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/IntrinsicsWebAssembly.td b/include/llvm/IR/IntrinsicsWebAssembly.td index 598349f7f04..1731995b287 100644 --- a/include/llvm/IR/IntrinsicsWebAssembly.td +++ b/include/llvm/IR/IntrinsicsWebAssembly.td @@ -40,7 +40,7 @@ def int_wasm_trunc_saturate_unsigned : Intrinsic<[llvm_anyint_ty], // 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 @@ def int_wasm_extract_exception : Intrinsic<[llvm_ptr_ty], [], // 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 @@ def int_wasm_memory_init : 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" diff --git a/test/CodeGen/WebAssembly/wasmehprepare.ll b/test/CodeGen/WebAssembly/wasmehprepare.ll index d06f95fd39c..742989f1038 100644 --- a/test/CodeGen/WebAssembly/wasmehprepare.ll +++ b/test/CodeGen/WebAssembly/wasmehprepare.ll @@ -405,6 +405,6 @@ declare i8* @__cxa_begin_catch(i8*) 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*)