| 1 |
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_EXT_image_raw10_raw12 %s -o - | FileCheck %s |
| 2 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s --spirv-ext=+SPV_EXT_image_raw10_raw12 -o - -filetype=obj | spirv-val %} |
| 3 |
|
| 4 |
; CHECK: OpExtension "SPV_EXT_image_raw10_raw12" |
| 5 |
|
| 6 |
define dso_local spir_kernel void @test_raw1012(ptr addrspace(1) noundef writeonly align 4 captures(none) %dst, target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %img) { |
| 7 |
entry: |
| 8 |
%call = tail call spir_func i32 @_Z27get_image_channel_data_type14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %img) |
| 9 |
switch i32 %call, label %sw.epilog [ |
| 10 |
i32 4304, label %sw.epilog.sink.split |
| 11 |
i32 4323, label %sw.bb1 |
| 12 |
i32 4324, label %sw.bb2 |
| 13 |
] |
| 14 |
|
| 15 |
sw.bb1: |
| 16 |
br label %sw.epilog.sink.split |
| 17 |
|
| 18 |
sw.bb2: |
| 19 |
br label %sw.epilog.sink.split |
| 20 |
|
| 21 |
sw.epilog.sink.split: |
| 22 |
%.sink = phi i32 [ 12, %sw.bb2 ], [ 10, %sw.bb1 ], [ 8, %entry ] |
| 23 |
store i32 %.sink, ptr addrspace(1) %dst, align 4 |
| 24 |
br label %sw.epilog |
| 25 |
|
| 26 |
sw.epilog: |
| 27 |
%call3 = tail call spir_func i32 @_Z27get_image_channel_data_type14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %img) |
| 28 |
%cmp = icmp eq i32 %call3, 4323 |
| 29 |
br i1 %cmp, label %if.end7.sink.split, label %if.else |
| 30 |
|
| 31 |
if.else: |
| 32 |
%call4 = tail call spir_func i32 @_Z27get_image_channel_data_type14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %img) |
| 33 |
%cmp5 = icmp eq i32 %call4, 4324 |
| 34 |
br i1 %cmp5, label %if.end7.sink.split, label %if.end7 |
| 35 |
|
| 36 |
if.end7.sink.split: |
| 37 |
%.sink14 = phi i32 [ 1010, %sw.epilog ], [ 1212, %if.else ] |
| 38 |
store i32 %.sink14, ptr addrspace(1) %dst, align 4 |
| 39 |
br label %if.end7 |
| 40 |
|
| 41 |
if.end7: |
| 42 |
ret void |
| 43 |
} |
| 44 |
|
| 45 |
declare spir_func i32 @_Z27get_image_channel_data_type14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0)) |