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.4 KiB
LLVM

; Tests lowering of sfclass/dfclass compares.
; Sub-optimal code
; {
; p0 = sfclass(r0,#16)
; r0 = sfadd(r0,r0)
; }
; {
; r2 = p0
; }
; {
; if (p0.new) r0 = ##1065353216
; p0 = cmp.eq(r2,#0)
; jumpr r31
; }
; With the patterns added, we should be generating
; {
; p0 = sfclass(r0,#16)
; r0 = sfadd(r0,r0)
; }
; {
; if (!p0) r0 = ##1065353216
; jumpr r31
; }
; RUN: llc -march=hexagon -stop-after=hexagon-isel %s -o - | FileCheck %s
; CHECK: bb.0.entry1
; CHECK: F2_sfclass
; CHECK-NOT: C2_cmp
; CHECK: C2_not
; CHECK: F2_sfadd
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
define float @test1(float noundef %x) {
entry1:
%0 = tail call i32 @llvm.hexagon.F2.sfclass(float %x, i32 16)
%tobool.not = icmp eq i32 %0, 0
%add = fadd float %x, %x
%spec.select = select i1 %tobool.not, float 1.000000e+00, float %add
ret float %spec.select
}
; CHECK: bb.0.entry2
; CHECK: F2_sfclass
; CHECK-NOT: C2_cmp
; CHECK: F2_sfadd
define float @test2(float noundef %x) {
entry2:
%0 = tail call i32 @llvm.hexagon.F2.sfclass(float %x, i32 16)
%tobool.not = icmp eq i32 %0, 0
%add = fadd float %x, %x
%spec.select = select i1 %tobool.not, float %add, float 1.000000e+00
ret float %spec.select
}
; CHECK: bb.0.entry3
; CHECK: F2_dfclass
; CHECK-NOT: C2_cmp
; CHECK: C2_not
; CHECK: F2_dfadd
define double @test3(double noundef %x) {
entry3:
%0 = tail call i32 @llvm.hexagon.F2.dfclass(double %x, i32 16)
%tobool.not = icmp eq i32 %0, 0
%add = fadd double %x, %x
%spec.select = select i1 %tobool.not, double 1.000000e+00, double %add
ret double %spec.select
}
; CHECK: bb.0.entry4
; CHECK: F2_dfclass
; CHECK-NOT: C2_cmp
; CHECK: F2_dfadd
define double @test4(double noundef %x) {
entry4:
%0 = tail call i32 @llvm.hexagon.F2.dfclass(double %x, i32 16)
%tobool.not = icmp eq i32 %0, 0
%add = fadd double %x, %x
%spec.select = select i1 %tobool.not, double %add, double 1.000000e+00
ret double %spec.select
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.hexagon.F2.dfclass(double, i32 immarg)
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.hexagon.F2.sfclass(float, i32 immarg)