Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SystemZ/codegenprepare-form-OF-ops.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

93 lines
2.0 KiB
LLVM

; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -O3 | FileCheck %s
;
; Check that CodeGenPrepare transforms these functions to use
; uadd.with.overflow / usub.with.overflow intrinsics so that the compare
; instruction is eliminated.
define i32 @uaddo_32(i32 %arg) {
; CHECK-LABEL: uaddo_32:
; CHECK: alhsik %r0, %r2, -1
; CHECK: locrnle %r2, %r0
; CHECK: br %r14
bb:
%tmp10 = icmp ne i32 %arg, 0
%tmp11 = add nsw i32 %arg, -1
%tmp12 = select i1 %tmp10, i32 %tmp11, i32 %arg
ret i32 %tmp12
}
define i64 @uaddo_64(i64 %arg) {
; CHECK-LABEL: uaddo_64:
; CHECK: alghsik %r0, %r2, -1
; CHECK: locgrnle %r2, %r0
; CHECK: br %r14
bb:
%tmp10 = icmp ne i64 %arg, 0
%tmp11 = add nsw i64 %arg, -1
%tmp12 = select i1 %tmp10, i64 %tmp11, i64 %arg
ret i64 %tmp12
}
define i32 @usubo_32(i32 %arg) {
; CHECK-LABEL: usubo_32:
; CHECK: alhsik %r0, %r2, -1
; CHECK: locrle %r2, %r0
; CHECK: br %r14
bb:
%tmp10 = icmp eq i32 %arg, 0
%tmp11 = sub nsw i32 %arg, 1
%tmp12 = select i1 %tmp10, i32 %tmp11, i32 %arg
ret i32 %tmp12
}
define i64 @usubo_64(i64 %arg) {
; CHECK-LABEL: usubo_64:
; CHECK: alghsik %r0, %r2, -1
; CHECK: locgrle %r2, %r0
; CHECK: br %r14
bb:
%tmp10 = icmp eq i64 %arg, 0
%tmp11 = sub nsw i64 %arg, 1
%tmp12 = select i1 %tmp10, i64 %tmp11, i64 %arg
ret i64 %tmp12
}
define i32 @optbranch_32(i32 %Arg) {
; CHECK-LABEL: optbranch_32:
; CHECK: alhsik %r2, %r2, 1
; CHECK-NEXT: bler %r14
; CHECK-NEXT: .LBB4_1:
; CHECK-NEXT: lhi %r2, -1
; CHECK-NEXT: br %r14
bb:
%i1 = icmp eq i32 %Arg, -1
br i1 %i1, label %bb2, label %bb3
bb2:
ret i32 -1
bb3:
%i4 = add nuw i32 %Arg, 1
ret i32 %i4
}
define i64 @optbranch_64(i64 %Arg) {
; CHECK-LABEL: optbranch_64:
; CHECK: alghsik %r2, %r2, 1
; CHECK-NEXT: bler %r14
; CHECK-NEXT: .LBB5_1:
; CHECK-NEXT: lghi %r2, -1
; CHECK-NEXT: br %r14
bb:
%i1 = icmp eq i64 %Arg, -1
br i1 %i1, label %bb2, label %bb3
bb2:
ret i64 -1
bb3:
%i4 = add nuw i64 %Arg, 1
ret i64 %i4
}