[Mlir-commits] [mlir] [mlir][emitc] Fix the emitc::ExpressionOp (PR #143894)
Simon Camphausen
llvmlistbot at llvm.org
Mon Jun 16 03:56:06 PDT 2025
================
@@ -406,6 +404,14 @@ LogicalResult ExpressionOp::verify() {
if (!yieldResult)
return emitOpError("must yield a value at termination");
+ Operation *rootOp = yieldResult.getDefiningOp();
+
+ if (!rootOp)
+ return emitOpError("yielded value has no defining op");
+
+ if (!isa<emitc::ExpressionOp>(rootOp->getParentOp()))
----------------
simon-camp wrote:
Should we check for identity here with `getOperation() == rootOp->getParentOp()` (untested)?
I think expressions cannot be nested currently, but this could possibly change in the future.
https://github.com/llvm/llvm-project/pull/143894
More information about the Mlir-commits
mailing list