Skip to content

Commit 9a7f0a0

Browse files
committed
[lumen] fix validation of landingpad op
1 parent 3757e7a commit 9a7f0a0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,13 @@ def LLVM_ResumeOp : LLVM_TerminatorOp<"resume", []> {
558558
let arguments = (ins LLVM_Type:$value);
559559
string llvmBuilder = [{ builder.CreateResume($value); }];
560560
let verifier = [{
561-
if (!isa_and_nonnull<LandingpadOp>(value().getDefiningOp()))
562-
return emitOpError("expects landingpad value as operand");
561+
Value v = value();
563562
// No check for personality of function - landingpad op verifies it.
564-
return success();
563+
if (isa_and_nonnull<LandingpadOp>(v.getDefiningOp()))
564+
return success();
565+
if (v && v.isa<BlockArgument>())
566+
return success();
567+
return emitOpError("expects landingpad value as operand");
565568
}];
566569

567570
let assemblyFormat = "$value attr-dict `:` type($value)";

0 commit comments

Comments
 (0)