[SCEV] Fix wrong initialization of MaxNotTaken
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 23 Nov 2022 08:13:40 +0000 (15:13 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Thu, 24 Nov 2022 09:13:38 +0000 (16:13 +0700)
I'm not sure why, but since this code was introduced back in 2019, this
variable used wrong value to initialize. Somehow it just worked, but
needs to be fixed.

Differential Revision: https://reviews.llvm.org/D138549
Reviewed By: fhahn

llvm/include/llvm/Analysis/ScalarEvolution.h

index 47fddb3..fa61583 100644 (file)
@@ -1367,7 +1367,7 @@ private:
                               const SCEV *MaxNotTaken,
                               const SmallPtrSet<const SCEVPredicate *, 4> &Predicates)
       : ExitingBlock(ExitingBlock), ExactNotTaken(ExactNotTaken),
-        MaxNotTaken(ExactNotTaken), Predicates(Predicates) {}
+        MaxNotTaken(MaxNotTaken), Predicates(Predicates) {}
 
     bool hasAlwaysTruePredicate() const {
       return Predicates.empty();