Files
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

87 lines
2.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
; RUN: llc -mtriple=x86_64-- -O0 -mattr=+zu < %s | FileCheck %s -check-prefix=SETZUCC
; RUN: llc -mtriple=x86_64-- -O0 -mattr=+zu,+prefer-legacy-setcc < %s | FileCheck %s -check-prefix=NO-SETZUCC
define i64 @adder(i64 %lhs, i64 %rhs) {
; CHECK-LABEL: adder:
; CHECK: # %bb.0:
; CHECK-NEXT: addq %rsi, %rdi
; CHECK-NEXT: seto %dl
; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: # kill: def $rax killed $eax
; CHECK-NEXT: movl $148, %ecx
; CHECK-NEXT: testb $1, %dl
; CHECK-NEXT: cmovneq %rcx, %rax
; CHECK-NEXT: retq
;
; SETZUCC-LABEL: adder:
; SETZUCC: # %bb.0:
; SETZUCC-NEXT: addq %rsi, %rdi
; SETZUCC-NEXT: setzuo %dl
; SETZUCC-NEXT: xorl %eax, %eax
; SETZUCC-NEXT: # kill: def $rax killed $eax
; SETZUCC-NEXT: movl $148, %ecx
; SETZUCC-NEXT: testb $1, %dl
; SETZUCC-NEXT: cmovneq %rcx, %rax
; SETZUCC-NEXT: retq
;
; NO-SETZUCC-LABEL: adder:
; NO-SETZUCC: # %bb.0:
; NO-SETZUCC-NEXT: addq %rsi, %rdi
; NO-SETZUCC-NEXT: seto %dl
; NO-SETZUCC-NEXT: xorl %eax, %eax
; NO-SETZUCC-NEXT: # kill: def $rax killed $eax
; NO-SETZUCC-NEXT: movl $148, %ecx
; NO-SETZUCC-NEXT: testb $1, %dl
; NO-SETZUCC-NEXT: cmovneq %rcx, %rax
; NO-SETZUCC-NEXT: retq
%res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
%errorbit = extractvalue { i64, i1 } %res, 1
%errorval = select i1 %errorbit, i64 148, i64 0
ret i64 %errorval
}
@a = global i32 0, align 4
define i64 @adder_constexpr(i64 %lhs, i64 %rhs) {
; CHECK-LABEL: adder_constexpr:
; CHECK: # %bb.0:
; CHECK-NEXT: addq %rsi, %rdi
; CHECK-NEXT: seto %dl
; CHECK-NEXT: movq a@GOTPCREL(%rip), %rax
; CHECK-NEXT: addq $5, %rax
; CHECK-NEXT: movl $148, %ecx
; CHECK-NEXT: testb $1, %dl
; CHECK-NEXT: cmovneq %rcx, %rax
; CHECK-NEXT: retq
;
; SETZUCC-LABEL: adder_constexpr:
; SETZUCC: # %bb.0:
; SETZUCC-NEXT: addq %rsi, %rdi
; SETZUCC-NEXT: setzuo %dl
; SETZUCC-NEXT: movq a@GOTPCREL(%rip), %rax
; SETZUCC-NEXT: addq $5, %rax
; SETZUCC-NEXT: movl $148, %ecx
; SETZUCC-NEXT: testb $1, %dl
; SETZUCC-NEXT: cmovneq %rcx, %rax
; SETZUCC-NEXT: retq
;
; NO-SETZUCC-LABEL: adder_constexpr:
; NO-SETZUCC: # %bb.0:
; NO-SETZUCC-NEXT: addq %rsi, %rdi
; NO-SETZUCC-NEXT: seto %dl
; NO-SETZUCC-NEXT: movq a@GOTPCREL(%rip), %rax
; NO-SETZUCC-NEXT: addq $5, %rax
; NO-SETZUCC-NEXT: movl $148, %ecx
; NO-SETZUCC-NEXT: testb $1, %dl
; NO-SETZUCC-NEXT: cmovneq %rcx, %rax
; NO-SETZUCC-NEXT: retq
%res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
%errorbit = extractvalue { i64, i1 } %res, 1
%errorval = select i1 %errorbit, i64 148, i64 add (i64 ptrtoint (ptr @a to i64), i64 5)
ret i64 %errorval
}
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)