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/include | |
| 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/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h | 5 | 
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);  | 

