[SCEV] Replace IsAvailableOnEntry with block disposition
authorNikita Popov <npopov@redhat.com>
Thu, 27 Apr 2023 13:11:02 +0000 (15:11 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 28 Apr 2023 09:02:03 +0000 (11:02 +0200)
commit103fc0f629aa6218783f65dff0197f257137cade
tree9be8792589c788c1a6ba57805950fc4abe138224
parentd961f66b28c592d3d34664b613c193cb3f75dd79
[SCEV] Replace IsAvailableOnEntry with block disposition

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.

Differential Revision: https://reviews.llvm.org/D149344
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/logical-operations.ll