[Mlir-commits] [mlir] [mlir][math] Propagate fast math attrs in AlgebraicSimplification (PR #166802)

Jakub Kuderski llvmlistbot at llvm.org
Tue Nov 18 09:34:29 PST 2025


================
@@ -43,6 +43,10 @@ PowFStrengthReduction::matchAndRewrite(math::PowFOp op,
                                        PatternRewriter &rewriter) const {
   Location loc = op.getLoc();
   Value x = op.getLhs();
+  arith::FastMathFlags fmf = op.getFastmathAttr().getValue();
+  arith::FastMathFlags intermediateFmf = arith::bitEnumClear(
+      fmf, arith::FastMathFlags::reassoc | arith::FastMathFlags::contract |
+               arith::FastMathFlags::arcp);
----------------
kuhar wrote:

Can you add a comment explaining why we need to clear these?

https://github.com/llvm/llvm-project/pull/166802


More information about the Mlir-commits mailing list