[Mlir-commits] [mlir] [mlir][vector] Fix crash on untraceable masks in getCompressedMaskOp (PR #207299)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jul 8 04:22:14 PDT 2026
================
@@ -98,10 +98,16 @@ static FailureOr<Operation *> getCompressedMaskOp(OpBuilder &rewriter,
if (auto extractOp = dyn_cast<vector::ExtractOp>(maskOp)) {
maskOp = extractOp.getSource().getDefiningOp();
extractOps.push_back(extractOp);
+ } else {
+ // Unsupported mask-defining op (e.g. a block argument, which has no
+ // defining op, or an op we cannot trace through). Bail out rather than
+ // looping forever or dereferencing a null op below.
+ break;
}
}
----------------
marquisburg wrote:
Done, restructured to bail out early with `return failure()` when the op isn't a `vector.extract`, and I went ahead and updated the comments
https://github.com/llvm/llvm-project/pull/207299
More information about the Mlir-commits
mailing list