|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=0 %s -S | FileCheck %s --check-prefix=STOP0 |
| 3 | +; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=1 %s -S | FileCheck %s --check-prefix=STOP1 |
| 4 | +; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=2 %s -S | FileCheck %s --check-prefix=STOP2 |
| 5 | +; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=3 %s -S | FileCheck %s --check-prefix=STOP3 |
| 6 | +; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=NOSTOP |
| 7 | + |
| 8 | +define void @stop_bndl(ptr %ptr) { |
| 9 | +; STOP0-LABEL: define void @stop_bndl( |
| 10 | +; STOP0-SAME: ptr [[PTR:%.*]]) { |
| 11 | +; STOP0-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0 |
| 12 | +; STOP0-NEXT: [[PTR1:%.*]] = getelementptr float, ptr [[PTR]], i32 1 |
| 13 | +; STOP0-NEXT: [[LD0:%.*]] = load float, ptr [[PTR0]], align 4 |
| 14 | +; STOP0-NEXT: [[LD1:%.*]] = load float, ptr [[PTR1]], align 4 |
| 15 | +; STOP0-NEXT: [[ADD0:%.*]] = fadd float [[LD0]], 0.000000e+00 |
| 16 | +; STOP0-NEXT: [[ADD1:%.*]] = fadd float [[LD1]], 0.000000e+00 |
| 17 | +; STOP0-NEXT: store float [[ADD0]], ptr [[PTR0]], align 4 |
| 18 | +; STOP0-NEXT: store float [[ADD1]], ptr [[PTR1]], align 4 |
| 19 | +; STOP0-NEXT: ret void |
| 20 | +; |
| 21 | +; STOP1-LABEL: define void @stop_bndl( |
| 22 | +; STOP1-SAME: ptr [[PTR:%.*]]) { |
| 23 | +; STOP1-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0 |
| 24 | +; STOP1-NEXT: [[PTR1:%.*]] = getelementptr float, ptr [[PTR]], i32 1 |
| 25 | +; STOP1-NEXT: [[LD0:%.*]] = load float, ptr [[PTR0]], align 4 |
| 26 | +; STOP1-NEXT: [[LD1:%.*]] = load float, ptr [[PTR1]], align 4 |
| 27 | +; STOP1-NEXT: [[ADD0:%.*]] = fadd float [[LD0]], 0.000000e+00 |
| 28 | +; STOP1-NEXT: [[ADD1:%.*]] = fadd float [[LD1]], 0.000000e+00 |
| 29 | +; STOP1-NEXT: [[PACK:%.*]] = insertelement <2 x float> poison, float [[ADD0]], i32 0 |
| 30 | +; STOP1-NEXT: [[PACK1:%.*]] = insertelement <2 x float> [[PACK]], float [[ADD1]], i32 1 |
| 31 | +; STOP1-NEXT: store <2 x float> [[PACK1]], ptr [[PTR0]], align 4 |
| 32 | +; STOP1-NEXT: ret void |
| 33 | +; |
| 34 | +; STOP2-LABEL: define void @stop_bndl( |
| 35 | +; STOP2-SAME: ptr [[PTR:%.*]]) { |
| 36 | +; STOP2-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0 |
| 37 | +; STOP2-NEXT: [[PTR1:%.*]] = getelementptr float, ptr [[PTR]], i32 1 |
| 38 | +; STOP2-NEXT: [[LD0:%.*]] = load float, ptr [[PTR0]], align 4 |
| 39 | +; STOP2-NEXT: [[LD1:%.*]] = load float, ptr [[PTR1]], align 4 |
| 40 | +; STOP2-NEXT: [[PACK:%.*]] = insertelement <2 x float> poison, float [[LD0]], i32 0 |
| 41 | +; STOP2-NEXT: [[PACK1:%.*]] = insertelement <2 x float> [[PACK]], float [[LD1]], i32 1 |
| 42 | +; STOP2-NEXT: [[VEC:%.*]] = fadd <2 x float> [[PACK1]], zeroinitializer |
| 43 | +; STOP2-NEXT: store <2 x float> [[VEC]], ptr [[PTR0]], align 4 |
| 44 | +; STOP2-NEXT: ret void |
| 45 | +; |
| 46 | +; STOP3-LABEL: define void @stop_bndl( |
| 47 | +; STOP3-SAME: ptr [[PTR:%.*]]) { |
| 48 | +; STOP3-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0 |
| 49 | +; STOP3-NEXT: [[VECL:%.*]] = load <2 x float>, ptr [[PTR0]], align 4 |
| 50 | +; STOP3-NEXT: [[VEC:%.*]] = fadd <2 x float> [[VECL]], zeroinitializer |
| 51 | +; STOP3-NEXT: store <2 x float> [[VEC]], ptr [[PTR0]], align 4 |
| 52 | +; STOP3-NEXT: ret void |
| 53 | +; |
| 54 | +; NOSTOP-LABEL: define void @stop_bndl( |
| 55 | +; NOSTOP-SAME: ptr [[PTR:%.*]]) { |
| 56 | +; NOSTOP-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0 |
| 57 | +; NOSTOP-NEXT: [[VECL:%.*]] = load <2 x float>, ptr [[PTR0]], align 4 |
| 58 | +; NOSTOP-NEXT: [[VEC:%.*]] = fadd <2 x float> [[VECL]], zeroinitializer |
| 59 | +; NOSTOP-NEXT: store <2 x float> [[VEC]], ptr [[PTR0]], align 4 |
| 60 | +; NOSTOP-NEXT: ret void |
| 61 | +; |
| 62 | + %ptr0 = getelementptr float, ptr %ptr, i32 0 |
| 63 | + %ptr1 = getelementptr float, ptr %ptr, i32 1 |
| 64 | + %ld0 = load float, ptr %ptr0 |
| 65 | + %ld1 = load float, ptr %ptr1 |
| 66 | + %add0 = fadd float %ld0, 0.0 |
| 67 | + %add1 = fadd float %ld1, 0.0 |
| 68 | + store float %add0, ptr %ptr0 |
| 69 | + store float %add1, ptr %ptr1 |
| 70 | + ret void |
| 71 | +} |
0 commit comments