|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
2 | | -; RUN: opt -mtriple=riscv64 -mcpu=sifive-x280 -passes=slp-vectorizer -S -slp-revec -slp-max-reg-size=1024 -slp-threshold=-100 %s | FileCheck %s |
| 2 | +; RUN: opt -mtriple=riscv64 -mcpu=sifive-x280 -passes=slp-vectorizer -S -slp-revec -slp-max-reg-size=1024 -slp-threshold=-100 %s | FileCheck --check-prefixes=CHECK,POWEROF2 %s |
| 3 | +; RUN: opt -mtriple=riscv64 -mcpu=sifive-x280 -passes=slp-vectorizer -S -slp-revec -slp-max-reg-size=1024 -slp-threshold=-100 -slp-vectorize-non-power-of-2 %s | FileCheck --check-prefixes=CHECK,NONPOWEROF2 %s |
3 | 4 |
|
4 | 5 | define i32 @test() { |
5 | 6 | ; CHECK-LABEL: @test( |
@@ -134,3 +135,41 @@ for.body: |
134 | 135 | %6 = select <2 x i1> %4, <2 x float> %3, <2 x float> zeroinitializer |
135 | 136 | br label %for.cond.cleanup |
136 | 137 | } |
| 138 | + |
| 139 | +define ptr @test4() { |
| 140 | + %1 = fadd <8 x float> zeroinitializer, zeroinitializer |
| 141 | + %2 = extractelement <8 x float> %1, i64 0 |
| 142 | + %3 = extractelement <8 x float> %1, i64 1 |
| 143 | + %4 = extractelement <8 x float> %1, i64 2 |
| 144 | + %5 = extractelement <8 x float> %1, i64 4 |
| 145 | + %6 = extractelement <8 x float> %1, i64 5 |
| 146 | + %7 = extractelement <8 x float> %1, i64 6 |
| 147 | + br label %9 |
| 148 | + |
| 149 | +8: |
| 150 | + br label %9 |
| 151 | + |
| 152 | +9: |
| 153 | + %10 = phi float [ 0.000000e+00, %8 ], [ %7, %0 ] |
| 154 | + %11 = phi float [ 0.000000e+00, %8 ], [ %6, %0 ] |
| 155 | + %12 = phi float [ 0.000000e+00, %8 ], [ %5, %0 ] |
| 156 | + %13 = phi float [ 0.000000e+00, %8 ], [ %4, %0 ] |
| 157 | + %14 = phi float [ 0.000000e+00, %8 ], [ %3, %0 ] |
| 158 | + %15 = phi float [ 0.000000e+00, %8 ], [ %2, %0 ] |
| 159 | + br label %16 |
| 160 | + |
| 161 | +16: |
| 162 | + %17 = fmul float %14, 0.000000e+00 |
| 163 | + %18 = fmul float 0.000000e+00, %11 |
| 164 | + %19 = fmul float 0.000000e+00, %15 |
| 165 | + %20 = fmul float %12, 0.000000e+00 |
| 166 | + %21 = fadd reassoc nsz float %17, %19 |
| 167 | + %22 = fadd reassoc nsz float %18, %20 |
| 168 | + %23 = fmul float %13, 0.000000e+00 |
| 169 | + %24 = fmul float %10, 0.000000e+00 |
| 170 | + %25 = fadd reassoc nsz float %21, %23 |
| 171 | + %26 = fadd reassoc nsz float %22, %24 |
| 172 | + %27 = tail call float @llvm.sqrt.f32(float %25) |
| 173 | + %28 = tail call float @llvm.sqrt.f32(float %26) |
| 174 | + ret ptr null |
| 175 | +} |
0 commit comments