[llvm] [DA] Rewrite BanerjeeMIV test with safe APInt interval arithmetic (PR #207662)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 06:42:57 PDT 2026


================
@@ -1922,36 +1922,167 @@ bool DependenceInfo::gcdMIVtest(const SCEV *Src, const SCEV *Dst,
 }
 
 //===----------------------------------------------------------------------===//
+
+namespace {
+struct BanerjeeInterval {
+  std::optional<APInt> Lower;
+  std::optional<APInt> Upper;
+
+  BanerjeeInterval(std::optional<APInt> Lower, std::optional<APInt> Upper)
----------------
kasuga-fj wrote:

I *think* it would be better to represent a half-open interval `[Lower, Upper)` instead of a closed interval. For example, we can simply express an empty interval by `BanerjeeInterval(C, C)`.

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


More information about the llvm-commits mailing list