[llvm] cd166fb - [SCEV] Use isAvailableAtLoopEntry in the asserts

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 21 03:11:25 PDT 2021


Author: Max Kazantsev
Date: 2021-09-21T17:11:15+07:00
New Revision: cd166fb2ef9c8fde374cb5de9c57802536d9b79e

URL: https://github.com/llvm/llvm-project/commit/cd166fb2ef9c8fde374cb5de9c57802536d9b79e
DIFF: https://github.com/llvm/llvm-project/commit/cd166fb2ef9c8fde374cb5de9c57802536d9b79e.diff

LOG: [SCEV] Use isAvailableAtLoopEntry in the asserts

This is what is supposed to be there.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index bf1a6e222d4e..0eff45db61bc 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -11836,9 +11836,9 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
   // so we get a backedge count of zero.
   const SCEV *BECount = nullptr;
   auto *OrigStartMinusStride = getMinusSCEV(OrigStart, Stride);
-  assert(isLoopInvariant(OrigStartMinusStride, L) && "Must be!");
-  assert(isLoopInvariant(OrigStart, L) && "Must be!");
-  assert(isLoopInvariant(OrigRHS, L) && "Must be!");
+  assert(isAvailableAtLoopEntry(OrigStartMinusStride, L) && "Must be!");
+  assert(isAvailableAtLoopEntry(OrigStart, L) && "Must be!");
+  assert(isAvailableAtLoopEntry(OrigRHS, L) && "Must be!");
   // Can we prove (max(RHS,Start) > Start - Stride?
   if (isLoopEntryGuardedByCond(L, Cond, OrigStartMinusStride, OrigStart) &&
       isLoopEntryGuardedByCond(L, Cond, OrigStartMinusStride, OrigRHS)) {


        


More information about the llvm-commits mailing list