Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SPIRV/llvm-intrinsics/expect.ll
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

111 lines
3.8 KiB
LLVM

; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; CHECK-SPIRV-NOT: OpCapability ExpectAssumeKHR
; CHECK-SPIRV-NOT: OpExtension "SPV_KHR_expect_assume"
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NOT: %[[#]] = OpExpectKHR %[[#]] %[[#]] %[[#]]
; CHECK-SPIRV: %[[#RES1:]] = OpSConvert %[[#]] %[[#]]
; CHECK-SPIRV: %[[#]] = OpINotEqual %[[#]] %[[#RES1]] %[[#]]
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV: %[[#RES2:]] = OpSConvert %[[#]] %[[#]]
; CHECK-SPIRV-NOT: %[[#]] = OpExpectKHR %[[#]] %[[#]] %[[#]]
; CHECK-SPIRV: %[[#]] = OpINotEqual %[[#]] %[[#RES2]] %[[#]]
%"class._ZTSZ4mainE3$_0.anon" = type { i8 }
define spir_kernel void @_ZTSZ4mainE15kernel_function() {
entry:
%0 = alloca %"class._ZTSZ4mainE3$_0.anon", align 1
%1 = bitcast ptr %0 to ptr
call void @llvm.lifetime.start.p0(i64 1, ptr %1)
%2 = addrspacecast ptr %0 to ptr addrspace(4)
call spir_func void @"_ZZ4mainENK3$_0clEv"(ptr addrspace(4) %2)
%3 = bitcast ptr %0 to ptr
call void @llvm.lifetime.end.p0(i64 1, ptr %3)
ret void
}
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
define internal spir_func void @"_ZZ4mainENK3$_0clEv"(ptr addrspace(4) %this) align 2 {
entry:
%this.addr = alloca ptr addrspace(4), align 8
%a = alloca i32, align 4
%b = alloca i32, align 4
store ptr addrspace(4) %this, ptr %this.addr, align 8
%this1 = load ptr addrspace(4), ptr %this.addr, align 8
%0 = bitcast ptr %a to ptr
call void @llvm.lifetime.start.p0(i64 4, ptr %0)
%call = call spir_func i32 @_Z12expect_consti(i32 1)
store i32 %call, ptr %a, align 4
%1 = bitcast ptr %b to ptr
call void @llvm.lifetime.start.p0(i64 4, ptr %1)
%call2 = call spir_func i32 @_Z10expect_funi(i32 2)
store i32 %call2, ptr %b, align 4
%2 = bitcast ptr %b to ptr
call void @llvm.lifetime.end.p0(i64 4, ptr %2)
%3 = bitcast ptr %a to ptr
call void @llvm.lifetime.end.p0(i64 4, ptr %3)
ret void
}
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
define spir_func i32 @_Z12expect_consti(i32 %x) {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
store i32 %x, ptr %x.addr, align 4
%0 = load i32, ptr %x.addr, align 4
%conv = sext i32 %0 to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
%tobool = icmp ne i64 %expval, 0
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 0, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
%1 = load i32, ptr %x.addr, align 4
store i32 %1, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
%2 = load i32, ptr %retval, align 4
ret i32 %2
}
define spir_func i32 @_Z10expect_funi(i32 %x) {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
store i32 %x, ptr %x.addr, align 4
%0 = load i32, ptr %x.addr, align 4
%conv = sext i32 %0 to i64
%call = call spir_func i32 @_Z3foov()
%conv1 = sext i32 %call to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 %conv1)
%tobool = icmp ne i64 %expval, 0
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 0, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
%1 = load i32, ptr %x.addr, align 4
store i32 %1, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
%2 = load i32, ptr %retval, align 4
ret i32 %2
}
declare i64 @llvm.expect.i64(i64, i64)
declare spir_func i32 @_Z3foov()