|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 |
| 2 | +; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s |
| 3 | + |
| 4 | +define i1 @test(double %circ_radius, ptr %x, double %0) { |
| 5 | +; CHECK-LABEL: define i1 @test( |
| 6 | +; CHECK-SAME: double [[CIRC_RADIUS:%.*]], ptr [[X:%.*]], double [[TMP0:%.*]]) { |
| 7 | +; CHECK-NEXT: [[ENTRY:.*:]] |
| 8 | +; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[X]], align 8 |
| 9 | +; CHECK-NEXT: [[ADD20:%.*]] = fadd double [[TMP1]], 0.000000e+00 |
| 10 | +; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x double> poison, double [[TMP0]], i32 3 |
| 11 | +; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x double> [[TMP2]], double [[TMP1]], i32 0 |
| 12 | +; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x double> [[TMP3]], double [[ADD20]], i32 2 |
| 13 | +; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x double> [[TMP4]], <4 x double> poison, <4 x i32> <i32 0, i32 0, i32 2, i32 3> |
| 14 | +; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <4 x double> [[TMP4]], <4 x double> <double 0.000000e+00, double poison, double 0.000000e+00, double 0.000000e+00>, <4 x i32> <i32 4, i32 0, i32 6, i32 7> |
| 15 | +; CHECK-NEXT: [[TMP7:%.*]] = fmul <4 x double> [[TMP5]], [[TMP6]] |
| 16 | +; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x double> [[TMP7]], <4 x double> poison, <4 x i32> <i32 1, i32 2, i32 poison, i32 0> |
| 17 | +; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x double> poison, double [[CIRC_RADIUS]], i32 0 |
| 18 | +; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x double> [[TMP9]], <4 x double> poison, <4 x i32> <i32 poison, i32 poison, i32 0, i32 poison> |
| 19 | +; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <4 x double> [[TMP8]], <4 x double> [[TMP10]], <4 x i32> <i32 0, i32 1, i32 6, i32 3> |
| 20 | +; CHECK-NEXT: [[TMP12:%.*]] = fadd <4 x double> [[TMP7]], [[TMP11]] |
| 21 | +; CHECK-NEXT: [[TMP13:%.*]] = call <4 x double> @llvm.sqrt.v4f64(<4 x double> [[TMP12]]) |
| 22 | +; CHECK-NEXT: [[TMP14:%.*]] = fcmp olt <4 x double> [[TMP13]], splat (double 1.000000e+00) |
| 23 | +; CHECK-NEXT: [[TMP15:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP14]]) |
| 24 | +; CHECK-NEXT: ret i1 [[TMP15]] |
| 25 | +; |
| 26 | +entry: |
| 27 | + %1 = load double, ptr %x, align 8 |
| 28 | + %square = fmul double %1, 0.000000e+00 |
| 29 | + %square105 = fmul double %1, %1 |
| 30 | + %add = fadd double %square, %square105 |
| 31 | + %sqrt116 = call double @llvm.sqrt.f64(double %add) |
| 32 | + %add20 = fadd double %1, 0.000000e+00 |
| 33 | + %square106 = fmul double %add20, 0.000000e+00 |
| 34 | + %add25 = fadd double %square105, %square106 |
| 35 | + %sqrt115 = call double @llvm.sqrt.f64(double %add25) |
| 36 | + %square109 = fmul double %0, 0.000000e+00 |
| 37 | + %add39 = fadd double %square106, %circ_radius |
| 38 | + %sqrt114 = call double @llvm.sqrt.f64(double %add39) |
| 39 | + %add50 = fadd double %square, %square109 |
| 40 | + %sqrt = call double @llvm.sqrt.f64(double %add50) |
| 41 | + %cmp52 = fcmp olt double %sqrt116, 1.000000e+00 |
| 42 | + %cmp54 = fcmp olt double %sqrt115, 1.000000e+00 |
| 43 | + %or.cond = or i1 %cmp52, %cmp54 |
| 44 | + %cmp57 = fcmp olt double %sqrt114, 1.000000e+00 |
| 45 | + %or.cond112 = or i1 %or.cond, %cmp57 |
| 46 | + %cmp60 = fcmp olt double %sqrt, 1.000000e+00 |
| 47 | + %or.cond113 = or i1 %or.cond112, %cmp60 |
| 48 | + ret i1 %or.cond113 |
| 49 | +} |
| 50 | + |
| 51 | +declare double @llvm.sqrt.f64(double) #0 |
| 52 | + |
0 commit comments