diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-30 19:24:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-30 19:24:31 +0000 |
commit | d777d405cdda8d418ba8e8818e5c1272dfd999a0 (patch) | |
tree | eccab7593cce33a8734bd8240436373600d92358 /include/llvm/Analysis | |
parent | 012618f0fc4df0664e6d7ad6b443173d89820213 (diff) | |
download | external_llvm-d777d405cdda8d418ba8e8818e5c1272dfd999a0.zip external_llvm-d777d405cdda8d418ba8e8818e5c1272dfd999a0.tar.gz external_llvm-d777d405cdda8d418ba8e8818e5c1272dfd999a0.tar.bz2 |
Cache TargetData/AliasAnalysis in the pass instead of calling
getAnalysis<>. getAnalysis<> is apparently extremely expensive.
Doing this speeds up GVN on 403.gcc by 16%!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 2dcec1b..c356981 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -25,6 +25,8 @@ namespace llvm { class FunctionPass; class Instruction; class CallSite; + class AliasAnalysis; + class TargetData; /// MemDepResult - A memory dependence query can return one of three different /// answers: @@ -148,13 +150,15 @@ namespace llvm { // A reverse mapping form dependencies to the non-local dependees. ReverseDepMapType ReverseNonLocalDeps; + /// Current AA implementation, just a cache. + AliasAnalysis *AA; + TargetData *TD; public: MemoryDependenceAnalysis() : FunctionPass(&ID) {} static char ID; - /// Pass Implementation stuff. This doesn't do any analysis. - /// - bool runOnFunction(Function &) {return false; } + /// Pass Implementation stuff. This doesn't do any analysis eagerly. + bool runOnFunction(Function &); /// Clean up memory in between runs void releaseMemory() { |