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
104 lines
2.4 KiB
LLVM
104 lines
2.4 KiB
LLVM
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -disable-cgp | FileCheck %s
|
|
;
|
|
; Check that signed comparisons against 0 are eliminated if the defining
|
|
; instruction is an add with immediate.
|
|
;
|
|
; Addition of an immediate does not depend on the "nsw" flag, since the
|
|
; result can be predicted in case of overflow. For example, if adding a
|
|
; positive immediate gives overflow, the result must be negative.
|
|
|
|
; Addition of a negative immediate gives a positive result in case of
|
|
; overflow (except for the case of the minimum value which may also result in
|
|
; a zero result).
|
|
define i32 @fun0(i32 %arg) {
|
|
; CHECK-LABEL: fun0:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locre
|
|
bb:
|
|
%tmp = add i32 %arg, -1
|
|
%tmp1 = icmp eq i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @fun1(i32 %arg) {
|
|
; CHECK-LABEL: fun1:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locrnle
|
|
bb:
|
|
%tmp = add i32 %arg, -1
|
|
%tmp1 = icmp sgt i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @fun2(i32 %arg) {
|
|
; CHECK-LABEL: fun2:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locrl
|
|
bb:
|
|
%tmp = add i32 %arg, -1
|
|
%tmp1 = icmp slt i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
; Addition of a positive immediate gives a negative result in case of overflow.
|
|
define i32 @fun3(i32 %arg) {
|
|
; CHECK-LABEL: fun3:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locre
|
|
bb:
|
|
%tmp = add i32 %arg, 1
|
|
%tmp1 = icmp eq i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @fun4(i32 %arg) {
|
|
; CHECK-LABEL: fun4:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locrh
|
|
bb:
|
|
%tmp = add i32 %arg, 1
|
|
%tmp1 = icmp sgt i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @fun5(i32 %arg) {
|
|
; CHECK-LABEL: fun5:
|
|
; CHECK: ahik
|
|
; CHECK-NEXT: locrnhe
|
|
bb:
|
|
%tmp = add i32 %arg, 1
|
|
%tmp1 = icmp slt i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
; Addition of the minimum value gives a positive or zero result.
|
|
define i32 @fun6(i32 %arg) {
|
|
; CHECK-LABEL: fun6:
|
|
; CHECK: afi
|
|
; CHECK-NEXT: chi
|
|
; CHECK-NEXT: locre
|
|
bb:
|
|
%tmp = add i32 %arg, -2147483648
|
|
%tmp1 = icmp eq i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @fun7(i32 %arg) {
|
|
; CHECK-LABEL: fun7:
|
|
; CHECK: afi
|
|
; CHECK-NEXT: chi
|
|
; CHECK-NEXT: locrh
|
|
bb:
|
|
%tmp = add i32 %arg, -2147483648
|
|
%tmp1 = icmp sgt i32 %tmp, 0
|
|
%res = select i1 %tmp1, i32 %tmp, i32 %arg
|
|
ret i32 %res
|
|
}
|