|
| 1 | +; RUN: clspv-opt --passes=long-vector-lowering %s -o %t.ll |
| 2 | +; RUN: FileCheck %s < %t.ll |
| 3 | + |
| 4 | +; CHECK-COUNT-8: call spir_func float @_Z3madfff( |
| 5 | + |
| 6 | +target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1" |
| 7 | +target triple = "spir-unknown-unknown" |
| 8 | + |
| 9 | +define spir_kernel void @foo(ptr addrspace(1) align 32 %a) { |
| 10 | +entry: |
| 11 | + %arrayidx = getelementptr inbounds <8 x float>, ptr addrspace(1) %a, i32 1 |
| 12 | + %0 = load <8 x float>, ptr addrspace(1) %arrayidx, align 32 |
| 13 | + %arrayidx1 = getelementptr inbounds <8 x float>, ptr addrspace(1) %a, i32 2 |
| 14 | + %1 = load <8 x float>, ptr addrspace(1) %arrayidx1, align 32 |
| 15 | + %arrayidx2 = getelementptr inbounds <8 x float>, ptr addrspace(1) %a, i32 3 |
| 16 | + %2 = load <8 x float>, ptr addrspace(1) %arrayidx2, align 32 |
| 17 | + %call = call spir_func <8 x float> @_Z3madDv8_fS_S_(<8 x float> %0, <8 x float> %1, <8 x float> %2) |
| 18 | + %arrayidx3 = getelementptr inbounds <8 x float>, ptr addrspace(1) %a, i32 0 |
| 19 | + store <8 x float> %call, ptr addrspace(1) %arrayidx3, align 32 |
| 20 | + ret void |
| 21 | +} |
| 22 | + |
| 23 | +declare spir_func <8 x float> @_Z3madDv8_fS_S_(<8 x float>, <8 x float>, <8 x float>) |
| 24 | + |
0 commit comments