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
87 lines
3.5 KiB
LLVM
87 lines
3.5 KiB
LLVM
; This test aims to check ability to support "Arithmetic with Overflow" intrinsics
|
|
; in the special case when those intrinsics are being generated by the CodeGenPrepare;
|
|
; pass during translations with optimization (note -disable-lsr, to inhibit
|
|
; strength reduction pre-empting with a more preferable match for this pattern
|
|
; in llc arguments).
|
|
|
|
; RUN: llc -O3 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; RUN: llc -O3 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; RUN: llc -O3 -disable-lsr -mtriple=spirv32-unknown-unknown %s -o - | FileCheck --check-prefix=NOLSR %s
|
|
; RUN: %if spirv-tools %{ llc -O3 -disable-lsr -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; RUN: llc -O3 -disable-lsr -mtriple=spirv64-unknown-unknown %s -o - | FileCheck --check-prefix=NOLSR %s
|
|
; RUN: %if spirv-tools %{ llc -O3 -disable-lsr -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; CHECK-DAG: %[[Int:.*]] = OpTypeInt 32 0
|
|
; CHECK-DAG: %[[Char:.*]] = OpTypeInt 8 0
|
|
; CHECK-DAG: %[[PtrChar:.*]] = OpTypePointer Generic %[[Char]]
|
|
; CHECK-DAG: %[[Bool:.*]] = OpTypeBool
|
|
; CHECK-DAG: %[[Const1:.*]] = OpConstant %[[Int]] 1{{$}}
|
|
; CHECK-DAG: %[[Zero:.*]] = OpConstantNull %[[Int]]
|
|
; CHECK-DAG: %[[Const42:.*]] = OpConstant %[[Char]] 42{{$}}
|
|
|
|
; CHECK: OpFunction
|
|
; CHECK: %[[A:.*]] = OpFunctionParameter %[[Int]]
|
|
; CHECK: %[[Ptr:.*]] = OpFunctionParameter %[[PtrChar]]
|
|
; CHECK: %[[APlusOne:.*]] = OpIAdd %[[Int]] %[[A]] %[[Const1]]
|
|
; CHECK: OpBranch %[[#]]
|
|
; CHECK: [[#]] = OpLabel
|
|
; CHECK: %[[PhiRes:.*]] = OpPhi %[[Int]] %[[Val:.*]] %[[#]] %[[APlusOne]] %[[#]]
|
|
; CHECK: %[[IsOver:.*]] = OpIEqual %[[Bool]] %[[#]] %[[#]]
|
|
; CHECK: OpBranchConditional %[[IsOver]] %[[#]] %[[#]]
|
|
; CHECK: [[#]] = OpLabel
|
|
; CHECK: OpStore %[[Ptr]] %[[Const42]] Aligned 1
|
|
; CHECK: [[Val]] = OpIAdd %[[Int]] %[[PhiRes]] %[[Const1]]
|
|
; CHECK: OpBranch %[[#]]
|
|
; CHECK: [[#]] = OpLabel
|
|
; OpReturnValue %[[PhiRes]]
|
|
|
|
; NOLSR-DAG: %[[Int:.*]] = OpTypeInt 32 0
|
|
; NOLSR-DAG: %[[Char:.*]] = OpTypeInt 8 0
|
|
; NOLSR-DAG: %[[PtrChar:.*]] = OpTypePointer Generic %[[Char]]
|
|
; NOLSR-DAG: %[[Bool:.*]] = OpTypeBool
|
|
; NOLSR-DAG: %[[Struct:.*]] = OpTypeStruct %[[Int]] %[[Int]]
|
|
; NOLSR-DAG: %[[Const1:.*]] = OpConstant %[[Int]] 1
|
|
; NOLSR-DAG: %[[Const42:.*]] = OpConstant %[[Char]] 42
|
|
; NOLSR-DAG: %[[Zero:.*]] = OpConstantNull %[[Int]]
|
|
|
|
; NOLSR: OpFunction
|
|
; NOLSR: %[[A:.*]] = OpFunctionParameter %[[Int]]
|
|
; NOLSR: %[[Ptr:.*]] = OpFunctionParameter %[[PtrChar]]
|
|
; NOLSR: %[[#]] = OpLabel
|
|
; NOLSR: OpBranch %[[#]]
|
|
; NOLSR: %[[#]] = OpLabel
|
|
; NOLSR: %[[PhiRes:.*]] = OpPhi %[[Int]] %[[A]] %[[#]] %[[Val:.*]] %[[#]]
|
|
; NOLSR: %[[AggRes:.*]] = OpIAddCarry %[[Struct]] %[[PhiRes]] %[[Const1]]
|
|
; NOLSR: %[[Val]] = OpCompositeExtract %[[Int]] %[[AggRes]] 0
|
|
; NOLSR: %[[Over:.*]] = OpCompositeExtract %[[Int]] %[[AggRes]] 1
|
|
; NOLSR: %[[IsOver:.*]] = OpINotEqual %[[Bool:.*]] %[[Over]] %[[Zero]]
|
|
; NOLSR: OpBranchConditional %[[IsOver]] %[[#]] %[[#]]
|
|
; NOLSR: OpStore %[[Ptr]] %[[Const42]] Aligned 1
|
|
; NOLSR: OpBranch %[[#]]
|
|
; NOLSR: %[[#]] = OpLabel
|
|
; NOLSR: OpReturnValue %[[Val]]
|
|
; NOLSR: OpFunctionEnd
|
|
|
|
define spir_func i32 @foo(i32 %a, ptr addrspace(4) %p) {
|
|
entry:
|
|
br label %l1
|
|
|
|
body:
|
|
store i8 42, ptr addrspace(4) %p
|
|
br label %l1
|
|
|
|
l1:
|
|
%e = phi i32 [ %a, %entry ], [ %i, %body ]
|
|
%i = add nsw i32 %e, 1
|
|
%fl = icmp eq i32 %i, 0
|
|
br i1 %fl, label %exit, label %body
|
|
|
|
exit:
|
|
ret i32 %i
|
|
}
|