[PATCH] D152513: [SCEV] Use isKnownNonZero() for SCEV verification

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 13:25:40 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:14055
+    // the same. In VerifySCEVStrict mode, report cases where we cannot prove
+    // that the expressions are the same.
+    if (VerifySCEVStrict ? !Delta->isZero() : SE2.isKnownNonZero(Delta))
----------------
goldstein.w.n wrote:
> I don't quite understand the new comment for "In VerifySCEVStrict mode...". Before it was clear; constants only. I don't see how `!Delta->isZero()` implies we are unable prove the expressions are the same but `isKnownNonZero(Delta)` doesn't.
The answer to "Is Delta zero?" can be "yes", "no" and "unknown". By default only "no" answers are verification failures. In VerifySCEVStrict mode "unknown" answers are verification failures as well (which is why they are almost certainly false positives).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152513/new/

https://reviews.llvm.org/D152513



More information about the llvm-commits mailing list