aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h6
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h2
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpressions.h30
3 files changed, 35 insertions, 3 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index ecf28adfc8..4d9d5e5fc0 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -237,12 +237,18 @@ namespace llvm {
}
SCEVHandle getSMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
SCEVHandle getSMaxExpr(std::vector<SCEVHandle> Operands);
+ SCEVHandle getUMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
+ SCEVHandle getUMaxExpr(std::vector<SCEVHandle> Operands);
SCEVHandle getUnknown(Value *V);
/// getNegativeSCEV - Return the SCEV object corresponding to -V.
///
SCEVHandle getNegativeSCEV(const SCEVHandle &V);
+ /// getNotSCEV - Return the SCEV object corresponding to ~V.
+ ///
+ SCEVHandle getNotSCEV(const SCEVHandle &V);
+
/// getMinusSCEV - Return LHS-RHS.
///
SCEVHandle getMinusSCEV(const SCEVHandle &LHS,
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 530ce37880..584e488f64 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -136,6 +136,8 @@ namespace llvm {
Value *visitSMaxExpr(SCEVSMaxExpr *S);
+ Value *visitUMaxExpr(SCEVUMaxExpr *S);
+
Value *visitUnknown(SCEVUnknown *S) {
return S->getValue();
}
diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 409ad9ecc4..905493a4af 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -25,7 +25,8 @@ namespace llvm {
// These should be ordered in terms of increasing complexity to make the
// folders simpler.
scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr,
- scUDivExpr, scAddRecExpr, scSMaxExpr, scUnknown, scCouldNotCompute
+ scUDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr, scUnknown,
+ scCouldNotCompute
};
//===--------------------------------------------------------------------===//
@@ -275,7 +276,8 @@ namespace llvm {
static inline bool classof(const SCEV *S) {
return S->getSCEVType() == scAddExpr ||
S->getSCEVType() == scMulExpr ||
- S->getSCEVType() == scSMaxExpr;
+ S->getSCEVType() == scSMaxExpr ||
+ S->getSCEVType() == scUMaxExpr;
}
};
@@ -483,6 +485,27 @@ namespace llvm {
//===--------------------------------------------------------------------===//
+ /// SCEVUMaxExpr - This class represents an unsigned maximum selection.
+ ///
+ class SCEVUMaxExpr : public SCEVCommutativeExpr {
+ friend class ScalarEvolution;
+
+ explicit SCEVUMaxExpr(const std::vector<SCEVHandle> &ops)
+ : SCEVCommutativeExpr(scUMaxExpr, ops) {
+ }
+
+ public:
+ virtual const char *getOperationStr() const { return " umax "; }
+
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const SCEVUMaxExpr *S) { return true; }
+ static inline bool classof(const SCEV *S) {
+ return S->getSCEVType() == scUMaxExpr;
+ }
+ };
+
+
+ //===--------------------------------------------------------------------===//
/// SCEVUnknown - This means that we are dealing with an entirely unknown SCEV
/// value, and only represent it as it's LLVM Value. This is the "bottom"
/// value for the analysis.
@@ -546,6 +569,8 @@ namespace llvm {
return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S);
case scSMaxExpr:
return ((SC*)this)->visitSMaxExpr((SCEVSMaxExpr*)S);
+ case scUMaxExpr:
+ return ((SC*)this)->visitUMaxExpr((SCEVUMaxExpr*)S);
case scUnknown:
return ((SC*)this)->visitUnknown((SCEVUnknown*)S);
case scCouldNotCompute:
@@ -565,4 +590,3 @@ namespace llvm {
}
#endif
-