summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-17 02:44:44 +0000
committerDan Gohman <gohman@apple.com>2010-11-17 02:44:44 +0000
commit6678e7b6eb534b43b92105076e6d0553e5cf7def (patch)
tree547878ba307aa707088bbea651834488cbae1d3f /include
parent32df92dde60a027612880e4701ce1b0246d65eae (diff)
downloadllvm-6678e7b6eb534b43b92105076e6d0553e5cf7def.tar.gz
llvm-6678e7b6eb534b43b92105076e6d0553e5cf7def.tar.bz2
llvm-6678e7b6eb534b43b92105076e6d0553e5cf7def.tar.xz
Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
This fixes some extreme compile times on unrolled sha512 code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h6
-rw-r--r--include/llvm/Support/ConstantRange.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 1fa94e9c31..f004f6c3f8 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -267,6 +267,12 @@ namespace llvm {
std::map<const SCEV *,
std::map<const Loop *, const SCEV *> > ValuesAtScopes;
+ /// UnsignedRanges - Memoized results from getUnsignedRange
+ DenseMap<const SCEV *, ConstantRange> UnsignedRanges;
+
+ /// SignedRanges - Memoized results from getSignedRange
+ DenseMap<const SCEV *, ConstantRange> SignedRanges;
+
/// createSCEV - We know that there is no SCEV for the specified value.
/// Analyze the expression.
const SCEV *createSCEV(Value *V);
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h
index 792b4107b1..c84e64ada9 100644
--- a/include/llvm/Support/ConstantRange.h
+++ b/include/llvm/Support/ConstantRange.h
@@ -47,6 +47,9 @@ public:
///
explicit ConstantRange(uint32_t BitWidth, bool isFullSet = true);
+ /// Default constructor that creates an uninitialized ConstantRange.
+ ConstantRange() {}
+
/// Initialize a range to hold the single specified value.
///
ConstantRange(const APInt &Value);