[Mlir-commits] [mlir] [mlir][Arith] Generalize and improve -int-range-optimizations (PR #94712)

Ivan Butygin llvmlistbot at llvm.org
Fri Jun 7 14:25:12 PDT 2024


================
@@ -24,88 +29,48 @@ using namespace mlir;
 using namespace mlir::arith;
 using namespace mlir::dataflow;
 
-/// Returns true if 2 integer ranges have intersection.
-static bool intersects(const ConstantIntRanges &lhs,
-                       const ConstantIntRanges &rhs) {
-  return !((lhs.smax().slt(rhs.smin()) || lhs.smin().sgt(rhs.smax())) &&
-           (lhs.umax().ult(rhs.umin()) || lhs.umin().ugt(rhs.umax())));
+std::optional<APInt> getMaybeConstantValue(DataFlowSolver &solver,
----------------
Hardcode84 wrote:

static?

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


More information about the Mlir-commits mailing list