aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2015-07-21 21:50:39 +0000
committerJingyue Wu <jingyue@google.com>2015-07-21 21:50:39 +0000
commitd058ea927f613ef4c787526c040dd6a957fc76d2 (patch)
tree7fae3738b604d6641fd433dab8b0aa5000af3222 /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parent525c73ceb70fc5c86cbfc246022402fa3d8a8f17 (diff)
downloadllvm-d058ea927f613ef4c787526c040dd6a957fc76d2.zip
llvm-d058ea927f613ef4c787526c040dd6a957fc76d2.tar.gz
llvm-d058ea927f613ef4c787526c040dd6a957fc76d2.tar.bz2
[MDA] change BlockScanLimit into a command line option.
Summary: In the benchmark (https://github.com/vetter/shoc) we are researching, the duplicated load is not eliminated because MemoryDependenceAnalysis hit the BlockScanLimit. This patch change it into a command line option instead of a hardcoded value. Patched by Xuetian Weng. Test Plan: test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll Reviewers: jingyue, reames Subscribers: reames, llvm-commits Differential Revision: http://reviews.llvm.org/D11366 llvm-svn: 242842
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 782a67b..51e3c4d9 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -49,7 +49,11 @@ STATISTIC(NumCacheCompleteNonLocalPtr,
"Number of block queries that were completely cached");
// Limit for the number of instructions to scan in a block.
-static const unsigned int BlockScanLimit = 100;
+
+static cl::opt<unsigned> BlockScanLimit(
+ "memdep-block-scan-limit", cl::Hidden, cl::init(100),
+ cl::desc("The number of instructions to scan in a block in memory "
+ "dependency analysis (default = 100)"));
// Limit on the number of memdep results to process.
static const unsigned int NumResultsLimit = 100;