summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2016-02-26 02:57:05 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2016-02-26 02:57:05 +0000
commit9f520ebc5413cd9561e3c8ee7f5d2dfc8db3ac23 (patch)
tree18785374d750d80bc482783b8526f7bc622b7311 /llvm/include
parentb850251d3e7110e050610e8652319db86ffeec65 (diff)
downloadbcm5719-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/include')
-rw-r--r--llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
index cfcc8ffbe5a..7e827e8737b 100644
--- a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
+++ b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
@@ -48,8 +48,8 @@ class UnrolledInstAnalyzer : private InstVisitor<UnrolledInstAnalyzer, bool> {
public:
UnrolledInstAnalyzer(unsigned Iteration,
DenseMap<Value *, Constant *> &SimplifiedValues,
- ScalarEvolution &SE)
- : SimplifiedValues(SimplifiedValues), SE(SE) {
+ ScalarEvolution &SE, const Loop *L)
+ : SimplifiedValues(SimplifiedValues), SE(SE), L(L) {
IterationNumber = SE.getConstant(APInt(64, Iteration));
}
@@ -80,6 +80,7 @@ private:
DenseMap<Value *, Constant *> &SimplifiedValues;
ScalarEvolution &SE;
+ const Loop *L;
bool simplifyInstWithSCEV(Instruction *I);
OpenPOWER on IntegriCloud