diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-31 21:15:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-31 21:15:23 +0000 |
commit | 42214899082bfb5b6f8c6a09d355fec9ef4a0e82 (patch) | |
tree | 9787b4979b555cb718f5c2a82fa5209a69d8fa63 /include | |
parent | b97cb9cbe120c50cd78c4d2c0b86d4dd8047b055 (diff) | |
download | external_llvm-42214899082bfb5b6f8c6a09d355fec9ef4a0e82.zip external_llvm-42214899082bfb5b6f8c6a09d355fec9ef4a0e82.tar.gz external_llvm-42214899082bfb5b6f8c6a09d355fec9ef4a0e82.tar.bz2 |
Extend the ValuesAtScope cache to cover all expressions, not just
SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code
can also end up repeatedly climing through the same expression trees,
which can be unusably slow when the trees are very tall.
Also, add a quick check for SCEV pointer equality to the main
SCEV comparison routine, as the full comparison code can be expensive
in the case of large expression trees.
These fix compile-time problems in some pathlogical cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 8e5f540..67e2659 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -219,10 +219,11 @@ namespace llvm { /// exit value. std::map<PHINode*, Constant*> ConstantEvolutionLoopExitValue; - /// ValuesAtScopes - This map contains entries for all the instructions - /// that we attempt to compute getSCEVAtScope information for without - /// using SCEV techniques, which can be expensive. - std::map<Instruction *, std::map<const Loop *, Constant *> > ValuesAtScopes; + /// ValuesAtScopes - This map contains entries for all the expressions + /// that we attempt to compute getSCEVAtScope information for, which can + /// be expensive in extreme cases. + std::map<const SCEV *, + std::map<const Loop *, const SCEV *> > ValuesAtScopes; /// createSCEV - We know that there is no SCEV for the specified value. /// Analyze the expression. @@ -236,6 +237,11 @@ namespace llvm { /// SCEVs. const SCEV *createNodeForGEP(Operator *GEP); + /// computeSCEVAtScope - Implementation code for getSCEVAtScope; called + /// at most once for each SCEV+Loop pair. + /// + const SCEV *computeSCEVAtScope(const SCEV *S, const Loop *L); + /// ForgetSymbolicValue - This looks up computed SCEV values for all /// instructions that depend on the given instruction and removes them from /// the Scalars map if they reference SymName. This is used during PHI |