diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-02-26 02:57:05 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-02-26 02:57:05 +0000 |
commit | 9f520ebc5413cd9561e3c8ee7f5d2dfc8db3ac23 (patch) | |
tree | 18785374d750d80bc482783b8526f7bc622b7311 /llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | |
parent | b850251d3e7110e050610e8652319db86ffeec65 (diff) | |
download | bcm5719-llvm-9f520ebc5413cd9561e3c8ee7f5d2dfc8db3ac23.tar.gz bcm5719-llvm-9f520ebc5413cd9561e3c8ee7f5d2dfc8db3ac23.zip |
[LoopUnrollAnalyzer] Check that we're using SCEV for the same loop we're simulating.
Summary: Check that we're using SCEV for the same loop we're simulating. Otherwise, we might try to use the iteration number of the current loop in SCEV expressions for inner/outer loops IVs, which is clearly incorrect.
Reviewers: chandlerc, hfinkel
Subscribers: sanjoy, llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D17632
llvm-svn: 261958
Diffstat (limited to 'llvm/lib/Analysis/LoopUnrollAnalyzer.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp index 92a2d1dad72..20e79a82eb9 100644 --- a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp +++ b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp @@ -37,7 +37,7 @@ bool UnrolledInstAnalyzer::simplifyInstWithSCEV(Instruction *I) { } auto *AR = dyn_cast<SCEVAddRecExpr>(S); - if (!AR) + if (!AR || AR->getLoop() != L) return false; const SCEV *ValueAtIteration = AR->evaluateAtIteration(IterationNumber, SE); |