CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
53 lines
1.5 KiB
LLVM
53 lines
1.5 KiB
LLVM
;; __kernel void test_switch(__global int* res, uchar val)
|
|
;; {
|
|
;; switch(val)
|
|
;; {
|
|
;; case 0:
|
|
;; *res = 1;
|
|
;; break;
|
|
;; case 1:
|
|
;; *res = 2;
|
|
;; break;
|
|
;; case 2:
|
|
;; *res = 3;
|
|
;; break;
|
|
;; }
|
|
;; }
|
|
|
|
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; CHECK-SPIRV: OpSwitch %[[#]] %[[#]] 0 %[[#]] 1 %[[#]] 2 %[[#]]
|
|
|
|
define spir_kernel void @test_switch(ptr addrspace(1) %res, i8 zeroext %val) {
|
|
entry:
|
|
%res.addr = alloca ptr addrspace(1), align 4
|
|
%val.addr = alloca i8, align 1
|
|
store ptr addrspace(1) %res, ptr %res.addr, align 4
|
|
store i8 %val, ptr %val.addr, align 1
|
|
%0 = load i8, ptr %val.addr, align 1
|
|
switch i8 %0, label %sw.epilog [
|
|
i8 0, label %sw.bb
|
|
i8 1, label %sw.bb1
|
|
i8 2, label %sw.bb2
|
|
]
|
|
|
|
sw.bb: ; preds = %entry
|
|
%1 = load ptr addrspace(1), ptr %res.addr, align 4
|
|
store i32 1, ptr addrspace(1) %1, align 4
|
|
br label %sw.epilog
|
|
|
|
sw.bb1: ; preds = %entry
|
|
%2 = load ptr addrspace(1), ptr %res.addr, align 4
|
|
store i32 2, ptr addrspace(1) %2, align 4
|
|
br label %sw.epilog
|
|
|
|
sw.bb2: ; preds = %entry
|
|
%3 = load ptr addrspace(1), ptr %res.addr, align 4
|
|
store i32 3, ptr addrspace(1) %3, align 4
|
|
br label %sw.epilog
|
|
|
|
sw.epilog: ; preds = %entry, %sw.bb2, %sw.bb1, %sw.bb
|
|
ret void
|
|
}
|