[Mlir-commits] [mlir] [mlir][scf] Fix trip count signedness and overflow in SCF Utils (PR #178782)
Jhalak Patel
llvmlistbot at llvm.org
Thu Jan 29 15:58:28 PST 2026
================
@@ -504,9 +516,13 @@ LogicalResult mlir::loopUnrollFull(scf::ForOp forOp) {
const APInt &tripCount = *mayBeConstantTripCount;
if (tripCount.isZero())
return success();
- if (tripCount.getZExtValue() == 1)
+ // Check for overflow before extracting trip count.
+ if (tripCount.getActiveBits() > 64)
----------------
jhalakpatel wrote:
This comment applies to many other instances in this PR.
https://github.com/llvm/llvm-project/pull/178782
More information about the Mlir-commits
mailing list