[llvm] r248923 - SLPVectorizer: add a test to check if the minimum region size works.

Erik Eckstein via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 10:28:19 PDT 2015


Author: eeckstein
Date: Wed Sep 30 12:28:19 2015
New Revision: 248923

URL: http://llvm.org/viewvc/llvm-project?rev=248923&view=rev
Log:
SLPVectorizer: add a test to check if the minimum region size works.

This is an addition to rL248917.


Modified:
    llvm/trunk/test/Transforms/SLPVectorizer/X86/schedule_budget.ll

Modified: llvm/trunk/test/Transforms/SLPVectorizer/X86/schedule_budget.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/schedule_budget.ll?rev=248923&r1=248922&r2=248923&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/schedule_budget.ll (original)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/schedule_budget.ll Wed Sep 30 12:28:19 2015
@@ -14,8 +14,15 @@ declare void @unknown()
 ; CHECK: load float
 ; CHECK: load float
 ; CHECK: call void @unknown
-define void @test(float * %a, float * %b) {
+; CHECK: store float
+; CHECK: store float
+; CHECK: store float
+; CHECK: store float
+; CHECK: load <4 x float>
+; CHECK: store <4 x float>
+define void @test(float * %a, float * %b, float * %c, float * %d) {
 entry:
+  ; Don't vectorize these loads.
   %l0 = load float, float* %a
   %a1 = getelementptr inbounds float, float* %a, i64 1
   %l1 = load float, float* %a1
@@ -54,6 +61,7 @@ entry:
   call void @unknown()
   call void @unknown()
 
+  ; Don't vectorize these stores because their operands are too far away.
   store float %l0, float* %b
   %b1 = getelementptr inbounds float, float* %b, i64 1
   store float %l1, float* %b1
@@ -61,6 +69,25 @@ entry:
   store float %l2, float* %b2
   %b3 = getelementptr inbounds float, float* %b, i64 3
   store float %l3, float* %b3
+
+  ; But still vectorize the following instructions, because even if the budget
+  ; is exceeded there is a minimum region size.
+  %l4 = load float, float* %c
+  %c1 = getelementptr inbounds float, float* %c, i64 1
+  %l5 = load float, float* %c1
+  %c2 = getelementptr inbounds float, float* %c, i64 2
+  %l6 = load float, float* %c2
+  %c3 = getelementptr inbounds float, float* %c, i64 3
+  %l7 = load float, float* %c3
+
+  store float %l4, float* %d
+  %d1 = getelementptr inbounds float, float* %d, i64 1
+  store float %l5, float* %d1
+  %d2 = getelementptr inbounds float, float* %d, i64 2
+  store float %l6, float* %d2
+  %d3 = getelementptr inbounds float, float* %d, i64 3
+  store float %l7, float* %d3
+
   ret void
 }
 




More information about the llvm-commits mailing list