[PATCH] D17464: [LoopDataPrefetch] Make it testable with opt
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 22 13:45:58 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261578: [LoopDataPrefetch] Make it testable with opt (authored by anemet).
Changed prior to commit:
http://reviews.llvm.org/D17464?vs=48547&id=48724#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17464
Files:
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/basic.ll
llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/lit.local.cfg
Index: llvm/trunk/include/llvm/InitializePasses.h
===================================================================
--- llvm/trunk/include/llvm/InitializePasses.h
+++ llvm/trunk/include/llvm/InitializePasses.h
@@ -163,6 +163,7 @@
void initializeLiveVariablesPass(PassRegistry&);
void initializeLoaderPassPass(PassRegistry&);
void initializeLocalStackSlotPassPass(PassRegistry&);
+void initializeLoopDataPrefetchPass(PassRegistry&);
void initializeLoopPassPass(PassRegistry&);
void initializeLoopDeletionPass(PassRegistry&);
void initializeLoopExtractorPass(PassRegistry&);
Index: llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/basic.ll
===================================================================
--- llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/basic.ll
+++ llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/basic.ll
@@ -0,0 +1,25 @@
+; RUN: opt -mcpu=a2 -loop-data-prefetch -S < %s | FileCheck %s
+target datalayout = "E-m:e-i64:64-n32:64"
+target triple = "powerpc64-bgq-linux"
+
+define void @foo(double* nocapture %a, double* nocapture readonly %b) {
+entry:
+ br label %for.body
+
+; CHECK: for.body:
+for.body: ; preds = %for.body, %entry
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %arrayidx = getelementptr inbounds double, double* %b, i64 %indvars.iv
+; CHECK: call void @llvm.prefetch
+ %0 = load double, double* %arrayidx, align 8
+ %add = fadd double %0, 1.000000e+00
+ %arrayidx2 = getelementptr inbounds double, double* %a, i64 %indvars.iv
+ store double %add, double* %arrayidx2, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1600
+ br i1 %exitcond, label %for.end, label %for.body
+
+; CHECK: for.end:
+for.end: ; preds = %for.body
+ ret void
+}
Index: llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/lit.local.cfg
===================================================================
--- llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/lit.local.cfg
+++ llvm/trunk/test/Transforms/LoopDataPrefetch/PowerPC/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'PowerPC' in config.root.targets:
+ config.unsupported = True
Index: llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
+++ llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
@@ -47,6 +47,7 @@
initializeIndVarSimplifyPass(Registry);
initializeJumpThreadingPass(Registry);
initializeLICMPass(Registry);
+ initializeLoopDataPrefetchPass(Registry);
initializeLoopDeletionPass(Registry);
initializeLoopAccessAnalysisPass(Registry);
initializeLoopInstSimplifyPass(Registry);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17464.48724.patch
Type: text/x-patch
Size: 2770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160222/4e54bee2/attachment.bin>
More information about the llvm-commits
mailing list