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

69 lines
2.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -o - %s | FileCheck %s
target triple = "x86_64-unknown-unknown"
; select with and i1/or i1 condition should be implemented as a series of 2
; cmovs, not by producing two conditions and using and on them.
define dso_local i32 @select_and(i32 %a0, i32 %a1, float %a2, float %a3, i32 %a4, i32 %a5) {
; CHECK-LABEL: select_and:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %edx, %eax
; CHECK-NEXT: ucomiss %xmm0, %xmm1
; CHECK-NEXT: cmovbel %ecx, %eax
; CHECK-NEXT: cmpl %esi, %edi
; CHECK-NEXT: cmovael %ecx, %eax
; CHECK-NEXT: retq
%cmp0 = icmp ult i32 %a0, %a1
%cmp1 = fcmp olt float %a2, %a3
%and = and i1 %cmp0, %cmp1
%res = select i1 %and, i32 %a4, i32 %a5
ret i32 %res
}
; select with and i1 condition should be implemented as a series of 2 cmovs, not
; by producing two conditions and using and on them.
define dso_local i32 @select_or(i32 %a0, i32 %a1, float %a2, float %a3, i32 %a4, i32 %a5) {
; CHECK-LABEL: select_or:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %ecx, %eax
; CHECK-NEXT: ucomiss %xmm0, %xmm1
; CHECK-NEXT: cmoval %edx, %eax
; CHECK-NEXT: cmpl %esi, %edi
; CHECK-NEXT: cmovbl %edx, %eax
; CHECK-NEXT: retq
%cmp0 = icmp ult i32 %a0, %a1
%cmp1 = fcmp olt float %a2, %a3
%and = or i1 %cmp0, %cmp1
%res = select i1 %and, i32 %a4, i32 %a5
ret i32 %res
}
; If one of the conditions is materialized as a 0/1 value anyway, then the
; sequence of 2 cmovs should not be used.
@var32 = dso_local global i32 0
define dso_local i32 @select_noopt(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
; CHECK-LABEL: select_noopt:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %ecx, %eax
; CHECK-NEXT: cmpl %esi, %edi
; CHECK-NEXT: setb %cl
; CHECK-NEXT: cmpl %edx, %esi
; CHECK-NEXT: setb %dl
; CHECK-NEXT: orb %cl, %dl
; CHECK-NEXT: movzbl %dl, %ecx
; CHECK-NEXT: movl %ecx, var32(%rip)
; CHECK-NEXT: testb %cl, %cl
; CHECK-NEXT: cmovel %r8d, %eax
; CHECK-NEXT: retq
%cmp0 = icmp ult i32 %a0, %a1
%cmp1 = icmp ult i32 %a1, %a2
%or = or i1 %cmp0, %cmp1
%zero_one = zext i1 %or to i32
store volatile i32 %zero_one, ptr @var32
%res = select i1 %or, i32 %a3, i32 %a4
ret i32 %res
}