Index: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td =================================================================== --- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -1542,6 +1542,15 @@ let assemblyFormat = "$handle attr-dict"; } +// +// Exception handling intrinsics. +// + +def LLVM_EhTypeIdForOp : LLVM_OneResultIntrOp<"eh.typeid.for"> { + let arguments = (ins LLVM_i8Ptr:$type_info); + let assemblyFormat = "$type_info attr-dict `:` type($res)"; +} + // // Stack save/restore intrinsics. // Index: mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir =================================================================== --- mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir +++ mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir @@ -485,6 +485,13 @@ llvm.return } +// CHECk-LABEL: @eh_typeid_for +llvm.func @eh_typeid_for(%arg0 : !llvm.ptr) { + // CHECK: call i32 @llvm.eh.typeid.for + %0 = llvm.intr.eh.typeid.for %arg0 : i32 + llvm.return +} + // CHECK-LABEL: @stack_save llvm.func @stack_save() { // CHECK: call i8* @llvm.stacksave