[Mlir-commits] [mlir] [mlir][IntRange] Poison support in int-range analysis (PR #152932)

Jakub Kuderski llvmlistbot at llvm.org
Sun Aug 17 17:52:29 PDT 2025


================
@@ -46,6 +47,16 @@ static std::optional<APInt> getMaybeConstantValue(DataFlowSolver &solver,
   return inferredRange.getConstantValue();
 }
 
+static bool isPoison(DataFlowSolver &solver, Value value) {
+  auto *maybeInferredRange =
+      solver.lookupState<IntegerValueRangeLattice>(value);
+  if (!maybeInferredRange || maybeInferredRange->getValue().isUninitialized())
+    return false;
+  const ConstantIntRanges &inferredRange =
+      maybeInferredRange->getValue().getValue();
+  return inferredRange.isSignedPoison() && inferredRange.isUnsignedPoison();
----------------
kuhar wrote:

Can you add a comment on why this uses `&&`?

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


More information about the Mlir-commits mailing list