[llvm-branch-commits] [llvm] [DA] Add overflow check in BanerjeeMIVtest (PR #190469)

Ryotaro Kasuga via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 6 01:01:53 PDT 2026


================
@@ -2261,7 +2261,13 @@ bool DependenceInfo::banerjeeMIVtest(const SCEV *Src, const SCEV *Dst,
   const SCEV *B0;
   CoefficientInfo *B = collectCoeffInfo(Dst, false, B0);
   BoundInfo *Bound = new BoundInfo[MaxLevels + 1];
-  const SCEV *Delta = SE->getMinusSCEV(B0, A0);
+  const SCEV *Delta = minusSCEVNoSignedOverflow(B0, A0, *SE);
+  if (!Delta) {
+    delete[] Bound;
+    delete[] A;
+    delete[] B;
----------------
kasuga-fj wrote:

I think calling `delete[]` before exiting the function every time is not ideal. This has been a pre-existing issue, but we should probably stop using `new`/`delete` altogether. I've submitted #190586, so could you wait for it to land and rebase after it’s merged?

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


More information about the llvm-branch-commits mailing list