[PATCH] D11366: [MDA] change BlockScanLimit into a command line option.

Jingyue Wu jingyue at google.com
Tue Jul 21 14:51:01 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL242842: [MDA] change BlockScanLimit into a command line option. (authored by jingyue).

Changed prior to commit:
  http://reviews.llvm.org/D11366?vs=30181&id=30290#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11366

Files:
  llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
  llvm/trunk/test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll

Index: llvm/trunk/test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll
===================================================================
--- llvm/trunk/test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll
+++ llvm/trunk/test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll
@@ -0,0 +1,15 @@
+; RUN: opt -S -memdep -gvn -basicaa < %s | FileCheck %s
+; RUN: opt -S -memdep -memdep-block-scan-limit=1 -gvn -basicaa < %s | FileCheck %s --check-prefix=WITH-LIMIT
+; CHECK-LABEL: @test(
+; CHECK: load
+; CHECK-NOT: load
+; WITH-LIMIT-LABEL: @test(
+; WITH-LIMIT-CHECK: load
+; WITH-LIMIT-CHECK: load
+define i32 @test(i32* %p) {
+ %1 = load i32, i32* %p
+ %2 = add i32 %1, 3
+ %3 = load i32, i32* %p
+ %4 = add i32 %2, %3
+ ret i32 %4
+}
Index: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
===================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -49,7 +49,11 @@
           "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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11366.30290.patch
Type: text/x-patch
Size: 1550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150721/4bf88499/attachment.bin>


More information about the llvm-commits mailing list