diff options
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 872bc52..980f142 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -2054,8 +2054,12 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx, LLVM_DEBUG(dbgs() << "LAA: Strided accesses are independent\n"); return Dependence::NoDep; } - } else - Dist = SE.applyLoopGuards(Dist, InnermostLoop); + } else { + if (!LoopGuards) + LoopGuards.emplace( + ScalarEvolution::LoopGuards::collect(InnermostLoop, SE)); + Dist = SE.applyLoopGuards(Dist, *LoopGuards); + } // Negative distances are not plausible dependencies. if (SE.isKnownNonPositive(Dist)) { |