[llvm] r356437 - [WebAssembly] Add immarg attribute to intrinsics
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 18 22:02:31 PDT 2019
Author: aheejin
Date: Mon Mar 18 22:02:30 2019
New Revision: 356437
URL: http://llvm.org/viewvc/llvm-project?rev=356437&view=rev
Log:
[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
Modified:
llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td
llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll
Modified: llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td?rev=356437&r1=356436&r2=356437&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td (original)
+++ llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td Mon Mar 18 22:02:30 2019
@@ -40,7 +40,7 @@ def int_wasm_trunc_saturate_unsigned : I
// 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 : Intrins
// 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"
Modified: llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll?rev=356437&r1=356436&r2=356437&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll Mon Mar 18 22:02:30 2019
@@ -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*)
More information about the llvm-commits
mailing list