diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td index d6aa0c5ebb9d80..33aeedf9181d14 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -558,10 +558,13 @@ def LLVM_ResumeOp : LLVM_TerminatorOp<"resume", []> { let arguments = (ins LLVM_Type:$value); string llvmBuilder = [{ builder.CreateResume($value); }]; let verifier = [{ - if (!isa_and_nonnull(value().getDefiningOp())) - return emitOpError("expects landingpad value as operand"); + Value v = value(); // No check for personality of function - landingpad op verifies it. - return success(); + if (isa_and_nonnull(v.getDefiningOp())) + return success(); + if (v && v.isa()) + return success(); + return emitOpError("expects landingpad value as operand"); }]; let assemblyFormat = "$value attr-dict `:` type($value)";