diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-02-17 00:13:06 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-17 00:13:06 +0000 |
| commit | 161861deb089479a2bf38989deb9c4225ae61f0d (patch) | |
| tree | f1d96a7d779f445a977228a2a0ccdf903e6dba77 /llvm/include | |
| parent | 2cd8982002c18cf09e0f6bf97ce1c308a9397f03 (diff) | |
| download | bcm5719-llvm-161861deb089479a2bf38989deb9c4225ae61f0d.tar.gz bcm5719-llvm-161861deb089479a2bf38989deb9c4225ae61f0d.zip | |
Strengthen the "non-constant stride must dominate loop preheader" check.
llvm-svn: 64703
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/ScalarEvolution.h | 8 | ||||
| -rw-r--r-- | llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index 0786b51f535..d94329d265b 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -89,6 +89,10 @@ namespace llvm { const SCEVHandle &Conc, ScalarEvolution &SE) const = 0; + /// dominates - Return true if elements that makes up this SCEV dominates + /// the specified basic block. + virtual bool dominates(BasicBlock *BB, DominatorTree *DT) const = 0; + /// print - Print out the internal representation of this scalar to the /// specified stream. This should really only be used for debugging /// purposes. @@ -124,6 +128,10 @@ namespace llvm { const SCEVHandle &Conc, ScalarEvolution &SE) const; + virtual bool dominates(BasicBlock *BB, DominatorTree *DT) const { + return true; + } + /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEVCouldNotCompute *S) { return true; } static bool classof(const SCEV *S); diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h index 652a99d0fca..61bb25a03b9 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -20,6 +20,7 @@ namespace llvm { class ConstantInt; class ConstantRange; class APInt; + class DominatorTree; enum SCEVTypes { // These should be ordered in terms of increasing complexity to make the @@ -58,6 +59,10 @@ namespace llvm { return this; } + bool dominates(BasicBlock *BB, DominatorTree *DT) const { + return true; + } + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } @@ -100,6 +105,8 @@ namespace llvm { return SE.getTruncateExpr(H, Ty); } + virtual bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } @@ -142,6 +149,8 @@ namespace llvm { return SE.getZeroExtendExpr(H, Ty); } + bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } @@ -184,6 +193,8 @@ namespace llvm { return SE.getSignExtendExpr(H, Ty); } + bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } @@ -250,6 +261,8 @@ namespace llvm { const SCEVHandle &Conc, ScalarEvolution &SE) const; + bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual const char *getOperationStr() const = 0; virtual const Type *getType() const { return getOperand(0)->getType(); } @@ -343,6 +356,7 @@ namespace llvm { return SE.getUDivExpr(L, R); } + bool dominates(BasicBlock *BB, DominatorTree *DT) const; virtual const Type *getType() const; @@ -437,6 +451,8 @@ namespace llvm { const SCEVHandle &Conc, ScalarEvolution &SE) const; + bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } @@ -518,6 +534,8 @@ namespace llvm { return this; } + bool dominates(BasicBlock *BB, DominatorTree *DT) const; + virtual const Type *getType() const; virtual void print(std::ostream &OS) const; |

