[Mlir-commits] [mlir] [mlir][Math] Fix IPowIOp folding crash for i1 (PR #179684)

Matthias Springer llvmlistbot at llvm.org
Thu Feb 5 04:20:34 PST 2026


================
@@ -370,7 +370,7 @@ OpFoldResult math::IPowIOp::fold(FoldAdaptor adaptor) {
       [](const APInt &base, const APInt &power) -> std::optional<APInt> {
         unsigned width = base.getBitWidth();
         auto zeroValue = APInt::getZero(width);
-        APInt oneValue{width, 1ULL, /*isSigned=*/true};
+        APInt oneValue{width, 1ULL, /*isSigned=*/false};
----------------
matthias-springer wrote:

`std::optional<APInt> oneValue = width == 1 ? std::nullopt : APInt(width, 1ULL, /*isSigned=*/true);`

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


More information about the Mlir-commits mailing list