[Mlir-commits] [mlir] [mlir][arith] Fix SelectOp unsafe int range inference with uninitialized range case (PR #173716)
Longsheng Du
llvmlistbot at llvm.org
Thu Jan 8 01:41:21 PST 2026
================
@@ -329,7 +329,13 @@ void arith::SelectOp::inferResultRangesFromOptional(
setResultRange(getResult(), trueCase);
return;
}
- setResultRange(getResult(), IntegerValueRange::join(trueCase, falseCase));
+
+ // When one of the ranges is uninitialized, set the whole range to max
+ // otherwise the result will ignore the uninitialized range.
+ if (trueCase.isUninitialized() || falseCase.isUninitialized())
----------------
LongshengDu wrote:
>From what I tested, `scf.switch` and `llvm.call` often return uninitialized int range as well, at least we should enforce some kind of check?
https://github.com/llvm/llvm-project/pull/173716
More information about the Mlir-commits
mailing list