[PATCH] D149344: [SCEV] Replace IsAvailableOnEntry with block disposition

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 06:40:05 PDT 2023


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

As far as I understand, the IsAvailableOnEntry() function basically implements the same functionality as the properlyDominates() block disposition. The primary difference (apart from a weaker implementation) seems to be in this comment at the top:

  // Checks if the SCEV S is available at BB.  S is considered available at BB
  // if S can be materialized at BB without introducing a fault.

However, I don't really understand why there would be such a requirement. It's my understanding that SCEV explicitly does not care about trapping udiv instructions itself, and it's the job of SCEVExpander's isSafeToExpand() to make sure these don't get expanded if they may trap.


https://reviews.llvm.org/D149344

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/logical-operations.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149344.517539.patch
Type: text/x-patch
Size: 4822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/7e028ce9/attachment.bin>


More information about the llvm-commits mailing list