[PATCH] D120551: [SCEV] Enable verification in LoopPM

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 02:52:01 PST 2022


nikic created this revision.
nikic added reviewers: mkazantsev, reames.
Herald added subscribers: pengfei, javed.absar, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently, we hardly ever actually run SCEV verification, even in tests with `-verify-scev`. This is because the NewPM LPM does not verify SCEV. The reason for this is that SCEV verification can actually change the result of subsequent SCEV queries, which means that you see different transformations depending on whether verification is enabled or not.

To allow verification in the LPM, this limits verification to BECounts that have actually been cached. It will not calculate new BECounts.

`BackedgeTakenInfo::getExact()` is still not entirely readonly, it still calls `getUMinFromMismatchedTypes()`. But I hope that this is not problematic in the same way.

Note that this still doesn't enable VerifySCEV under EXPENSIVE_CHECKS, llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll fails verification with `-verify-scev` after these changes.


https://reviews.llvm.org/D120551

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/Transforms/Scalar/LoopPassManager.cpp
  llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120551.411362.patch
Type: text/x-patch
Size: 3943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220225/4c3ebe3c/attachment.bin>


More information about the llvm-commits mailing list