[Mlir-commits] [mlir] [mlir] added a check in the walk to prevent catching a cos in a nested region (PR #190064)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 1 18:07:50 PDT 2026
================
@@ -27,13 +27,13 @@ struct SincosFusionPattern : OpRewritePattern<math::SinOp> {
mlir::arith::FastMathFlags sinFastMathFlags = sinOp.getFastmath();
math::CosOp cosOp = nullptr;
- sinOp->getBlock()->walk([&](math::CosOp op) {
+ for (auto op : sinOp->getBlock()->getOps<math::CosOp>()) {
if (op.getOperand() == operand && op.getFastmath() == sinFastMathFlags) {
cosOp = op;
return WalkResult::interrupt();
}
return WalkResult::advance();
- });
+ }
----------------
yebinchon wrote:
I can't believe I missed that thank you!!
https://github.com/llvm/llvm-project/pull/190064
More information about the Mlir-commits
mailing list