Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/apx/setzucc.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

125 lines
3.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64 -mattr=+zu,+prefer-legacy-setcc | FileCheck %s --check-prefixes=CHECK,PREFER_NO_SETZUCC
; RUN: llc < %s -mtriple=x86_64 -mattr=+zu | FileCheck %s --check-prefixes=CHECK,PREFER_SETZUCC
define i16 @i8(i8 %x) nounwind {
; CHECK-LABEL: i8:
; CHECK: # %bb.0:
; CHECK-NEXT: cmpb $3, %dil
; CHECK-NEXT: setzuae %al
; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-NEXT: retq
%t0 = icmp ugt i8 %x, 2
%zext = zext i1 %t0 to i16
ret i16 %zext
}
define i16 @i16(i16 %x) nounwind {
; CHECK-LABEL: i16:
; CHECK: # %bb.0:
; CHECK-NEXT: cmpw $2, %di
; CHECK-NEXT: setzub %al
; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-NEXT: retq
%t0 = icmp ult i16 %x, 2
%if = select i1 %t0, i16 1, i16 0
ret i16 %if
}
define i32 @i32(i32 %x) nounwind {
; CHECK-LABEL: i32:
; CHECK: # %bb.0:
; CHECK-NEXT: cmpl $1, %edi
; CHECK-NEXT: setzue %al
; CHECK-NEXT: retq
%t0 = icmp eq i32 %x, 1
%if = select i1 %t0, i32 1, i32 0
ret i32 %if
}
define i64 @i64(i64 %x) nounwind {
; CHECK-LABEL: i64:
; CHECK: # %bb.0:
; CHECK-NEXT: cmpq $1, %rdi
; CHECK-NEXT: setzune %al
; CHECK-NEXT: retq
%t0 = icmp ne i64 %x, 1
%if = select i1 %t0, i64 1, i64 0
ret i64 %if
}
define i32 @flags_copy_lowering() nounwind {
; PREFER_NO_SETZUCC-LABEL: flags_copy_lowering:
; PREFER_NO_SETZUCC: # %bb.0: # %bb
; PREFER_NO_SETZUCC-NEXT: xorl %eax, %eax
; PREFER_NO_SETZUCC-NEXT: xorl %ecx, %ecx
; PREFER_NO_SETZUCC-NEXT: xorl %edx, %edx
; PREFER_NO_SETZUCC-NEXT: .p2align 4
; PREFER_NO_SETZUCC-NEXT: .LBB4_1: # %bb1
; PREFER_NO_SETZUCC-NEXT: # =>This Inner Loop Header: Depth=1
; PREFER_NO_SETZUCC-NEXT: addl %ecx, 0
; PREFER_NO_SETZUCC-NEXT: setb %cl
; PREFER_NO_SETZUCC-NEXT: adcl $0, %edx
; PREFER_NO_SETZUCC-NEXT: testb %cl, %cl
; PREFER_NO_SETZUCC-NEXT: je .LBB4_3
; PREFER_NO_SETZUCC-NEXT: # %bb.2: # %bb1
; PREFER_NO_SETZUCC-NEXT: # in Loop: Header=BB4_1 Depth=1
; PREFER_NO_SETZUCC-NEXT: testb %al, %al
; PREFER_NO_SETZUCC-NEXT: jne .LBB4_1
; PREFER_NO_SETZUCC-NEXT: .LBB4_3: # %bb2
; PREFER_NO_SETZUCC-NEXT: xorl %eax, %eax
; PREFER_NO_SETZUCC-NEXT: retq
;
; PREFER_SETZUCC-LABEL: flags_copy_lowering:
; PREFER_SETZUCC: # %bb.0: # %bb
; PREFER_SETZUCC-NEXT: xorl %eax, %eax
; PREFER_SETZUCC-NEXT: xorl %ecx, %ecx
; PREFER_SETZUCC-NEXT: xorl %edx, %edx
; PREFER_SETZUCC-NEXT: .p2align 4
; PREFER_SETZUCC-NEXT: .LBB4_1: # %bb1
; PREFER_SETZUCC-NEXT: # =>This Inner Loop Header: Depth=1
; PREFER_SETZUCC-NEXT: addl %ecx, 0
; PREFER_SETZUCC-NEXT: setzub %cl
; PREFER_SETZUCC-NEXT: adcl $0, %edx
; PREFER_SETZUCC-NEXT: testb %cl, %cl
; PREFER_SETZUCC-NEXT: je .LBB4_3
; PREFER_SETZUCC-NEXT: # %bb.2: # %bb1
; PREFER_SETZUCC-NEXT: # in Loop: Header=BB4_1 Depth=1
; PREFER_SETZUCC-NEXT: testb %al, %al
; PREFER_SETZUCC-NEXT: jne .LBB4_1
; PREFER_SETZUCC-NEXT: .LBB4_3: # %bb2
; PREFER_SETZUCC-NEXT: xorl %eax, %eax
; PREFER_SETZUCC-NEXT: retq
bb:
br label %bb1
bb1:
%phi = phi i32 [ 0, %bb ], [ %zext, %bb1 ]
%phi2 = phi i32 [ 0, %bb ], [ %add3, %bb1 ]
%load = load i32, ptr null, align 4
%add = add i32 %load, %phi
store i32 %add, ptr null, align 4
%icmp = icmp ugt i32 %phi, %add
%zext = zext i1 %icmp to i32
%add3 = add i32 %phi2, %zext
%icmp4 = icmp ult i32 %phi2, 0
%and = and i1 %icmp, false
br i1 %and, label %bb1, label %bb2
bb2:
ret i32 0
}
define i32 @def_use_eflag(i32 %a, i32 %b, i8 %c) {
; CHECK-LABEL: def_use_eflag:
; CHECK: # %bb.0:
; CHECK-NEXT: addb $-1, %dl
; CHECK-NEXT: adcl %esi, %edi
; CHECK-NEXT: setzub %al
; CHECK-NEXT: retq
%1 = call { i8, i32 } @llvm.x86.addcarry.32(i8 %c, i32 %a, i32 %b)
%2 = extractvalue { i8, i32 } %1, 0
%3 = zext i8 %2 to i32
ret i32 %3
}