diff options
author | Philip Reames <listmail@philipreames.com> | 2021-05-26 10:40:25 -0700 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2021-05-26 10:41:49 -0700 |
commit | 921d3f7af09c6a08d2d2897e6fcce6127a9f4fd4 (patch) | |
tree | 2efbc28db8a0394d28962d6b3febe5d7f0583845 /llvm/lib/Analysis/LoopCacheAnalysis.cpp | |
parent | 9065118b6463adf6cc5552f202cd8302c21cd7b0 (diff) | |
download | llvm-921d3f7af09c6a08d2d2897e6fcce6127a9f4fd4.zip llvm-921d3f7af09c6a08d2d2897e6fcce6127a9f4fd4.tar.gz llvm-921d3f7af09c6a08d2d2897e6fcce6127a9f4fd4.tar.bz2 |
[SCEV] Add a utility for converting from "exit count" to "trip count"
(Mostly as a logical place to put a comment since this is a reoccuring confusion.)
Diffstat (limited to 'llvm/lib/Analysis/LoopCacheAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopCacheAnalysis.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp index cf68596..8a61364 100644 --- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp +++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp @@ -109,9 +109,7 @@ static const SCEV *computeTripCount(const Loop &L, ScalarEvolution &SE) { if (isa<SCEVCouldNotCompute>(BackedgeTakenCount) || !isa<SCEVConstant>(BackedgeTakenCount)) return nullptr; - - return SE.getAddExpr(BackedgeTakenCount, - SE.getOne(BackedgeTakenCount->getType())); + return SE.getTripCountFromExitCount(BackedgeTakenCount); } //===----------------------------------------------------------------------===// |