Skip to content

Commit 16ccba0

Browse files
committed
[mlir] fix IntegerRangeAnalysis::staticallyNonNegative
1 parent adba14a commit 16ccba0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ LogicalResult staticallyNonNegative(DataFlowSolver &solver, Value v) {
4343
if (!result || result->getValue().isUninitialized())
4444
return failure();
4545
const ConstantIntRanges &range = result->getValue().getValue();
46+
if (range.umin().getBitWidth() || range.umax().getBitWidth() ||
47+
range.smin().getBitWidth() || range.smax().getBitWidth())
48+
return false;
4649
return success(range.smin().isNonNegative());
4750
}
4851

0 commit comments

Comments
 (0)