aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-06-23 21:52:50 +0000
committerHal Finkel <hfinkel@anl.gov>2012-06-23 21:52:50 +0000
commite415f96b6a43ac8861148a11a4258bc38c247e8f (patch)
treea3c03b9d3fc7c2b94d24b8bc12eddbd6b5579de2 /test
parent624a9c49d436947b6ad56140966fa76e574f43ef (diff)
downloadexternal_llvm-e415f96b6a43ac8861148a11a4258bc38c247e8f.zip
external_llvm-e415f96b6a43ac8861148a11a4258bc38c247e8f.tar.gz
external_llvm-e415f96b6a43ac8861148a11a4258bc38c247e8f.tar.bz2
Allow BBVectorize to fuse compare instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/BBVectorize/simple-sel.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/BBVectorize/simple-sel.ll b/test/Transforms/BBVectorize/simple-sel.ll
index 4daa571..7fb9c8b 100644
--- a/test/Transforms/BBVectorize/simple-sel.ll
+++ b/test/Transforms/BBVectorize/simple-sel.ll
@@ -27,4 +27,30 @@ define double @test1(double %A1, double %A2, double %B1, double %B2, i1 %C1, i1
; CHECK: ret double %R
}
+; Basic depth-3 chain with select (and vect. compare)
+define double @test2(double %A1, double %A2, double %B1, double %B2) {
+; CHECK: @test2
+; CHECK: %X1.v.i1.1 = insertelement <2 x double> undef, double %B1, i32 0
+; CHECK: %X1.v.i0.1 = insertelement <2 x double> undef, double %A1, i32 0
+; CHECK: %X1.v.i1.2 = insertelement <2 x double> %X1.v.i1.1, double %B2, i32 1
+; CHECK: %X1.v.i0.2 = insertelement <2 x double> %X1.v.i0.1, double %A2, i32 1
+ %X1 = fsub double %A1, %B1
+ %X2 = fsub double %A2, %B2
+; CHECK: %X1 = fsub <2 x double> %X1.v.i0.2, %X1.v.i1.2
+ %Y1 = fmul double %X1, %A1
+ %Y2 = fmul double %X2, %A2
+; CHECK: %Y1 = fmul <2 x double> %X1, %X1.v.i0.2
+ %C1 = fcmp ogt double %X1, %A1
+ %C2 = fcmp ogt double %X2, %A2
+; CHECK: %C1 = fcmp ogt <2 x double> %X1, %X1.v.i0.2
+ %Z1 = select i1 %C1, double %Y1, double %B1
+ %Z2 = select i1 %C2, double %Y2, double %B2
+; CHECK: %Z1 = select <2 x i1> %C1, <2 x double> %Y1, <2 x double> %X1.v.i1.2
+ %R = fmul double %Z1, %Z2
+; CHECK: %Z1.v.r1 = extractelement <2 x double> %Z1, i32 0
+; CHECK: %Z1.v.r2 = extractelement <2 x double> %Z1, i32 1
+; CHECK: %R = fmul double %Z1.v.r1, %Z1.v.r2
+ ret double %R
+; CHECK: ret double %R
+}