[llvm] d3e21ba - [SCEV] Fix wrong initialization of MaxNotTaken

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 01:14:19 PST 2022


Author: Max Kazantsev
Date: 2022-11-24T16:13:38+07:00
New Revision: d3e21ba550ba1351bc145c72a0b7342c622d108e

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

LOG: [SCEV] Fix wrong initialization of MaxNotTaken

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

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/ScalarEvolution.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 47fddb389e01f..fa615834e9fce 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -1367,7 +1367,7 @@ class ScalarEvolution {
                               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();


        


More information about the llvm-commits mailing list