Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InstCombine/canonicalize-fcmp-inf.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

287 lines
6.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define i1 @olt_pinf(half %x) {
; CHECK-LABEL: define i1 @olt_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp one half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp olt half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ole_pinf(half %x) {
; CHECK-LABEL: define i1 @ole_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ole half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ogt_pinf(half %x) {
; CHECK-LABEL: define i1 @ogt_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 false
;
%cmp = fcmp ogt half %x, 0xH7c00
ret i1 %cmp
}
define i1 @oge_pinf(half %x) {
; CHECK-LABEL: define i1 @oge_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp oge half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ult_pinf(half %x) {
; CHECK-LABEL: define i1 @ult_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp une half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ult half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ule_pinf(half %x) {
; CHECK-LABEL: define i1 @ule_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 true
;
%cmp = fcmp ule half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ugt_pinf(half %x) {
; CHECK-LABEL: define i1 @ugt_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp uno half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ugt half %x, 0xH7c00
ret i1 %cmp
}
define i1 @uge_pinf(half %x) {
; CHECK-LABEL: define i1 @uge_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp uge half %x, 0xH7c00
ret i1 %cmp
}
define i1 @olt_ninf(half %x) {
; CHECK-LABEL: define i1 @olt_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 false
;
%cmp = fcmp olt half %x, 0xHfc00
ret i1 %cmp
}
define i1 @ole_ninf(half %x) {
; CHECK-LABEL: define i1 @ole_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq half [[X]], -inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ole half %x, 0xHfc00
ret i1 %cmp
}
define i1 @ogt_ninf(half %x) {
; CHECK-LABEL: define i1 @ogt_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp one half [[X]], -inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ogt half %x, 0xHfc00
ret i1 %cmp
}
define i1 @oge_ninf(half %x) {
; CHECK-LABEL: define i1 @oge_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp oge half %x, 0xHfc00
ret i1 %cmp
}
define i1 @ult_ninf(half %x) {
; CHECK-LABEL: define i1 @ult_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp uno half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ult half %x, 0xHfc00
ret i1 %cmp
}
define i1 @ule_ninf(half %x) {
; CHECK-LABEL: define i1 @ule_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq half [[X]], -inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ule half %x, 0xHfc00
ret i1 %cmp
}
define i1 @ugt_ninf(half %x) {
; CHECK-LABEL: define i1 @ugt_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp une half [[X]], -inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ugt half %x, 0xHfc00
ret i1 %cmp
}
define i1 @uge_ninf(half %x) {
; CHECK-LABEL: define i1 @uge_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 true
;
%cmp = fcmp uge half %x, 0xHfc00
ret i1 %cmp
}
define i1 @olt_pinf_fmf(half %x) {
; CHECK-LABEL: define i1 @olt_pinf_fmf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp nsz one half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp nsz olt half %x, 0xH7c00
ret i1 %cmp
}
define i1 @oge_pinf_fmf(half %x) {
; CHECK-LABEL: define i1 @oge_pinf_fmf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp nnan oeq half [[X]], +inf
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp nnan oge half %x, 0xH7c00
ret i1 %cmp
}
define <2 x i1> @olt_pinf_vec(<2 x half> %x) {
; CHECK-LABEL: define <2 x i1> @olt_pinf_vec(
; CHECK-SAME: <2 x half> [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp one <2 x half> [[X]], splat (half +inf)
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%cmp = fcmp olt <2 x half> %x, <half 0xH7c00, half 0xH7c00>
ret <2 x i1> %cmp
}
define <2 x i1> @oge_ninf_vec(<2 x half> %x) {
; CHECK-LABEL: define <2 x i1> @oge_ninf_vec(
; CHECK-SAME: <2 x half> [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord <2 x half> [[X]], zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%cmp = fcmp oge <2 x half> %x, <half 0xHfc00, half 0xHfc00>
ret <2 x i1> %cmp
}
; Negative tests
define i1 @ord_pinf(half %x) {
; CHECK-LABEL: define i1 @ord_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ord half %x, 0xH7c00
ret i1 %cmp
}
define i1 @uno_pinf(half %x) {
; CHECK-LABEL: define i1 @uno_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp uno half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp uno half %x, 0xH7c00
ret i1 %cmp
}
define i1 @true_pinf(half %x) {
; CHECK-LABEL: define i1 @true_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 true
;
%cmp = fcmp true half %x, 0xH7c00
ret i1 %cmp
}
define i1 @false_pinf(half %x) {
; CHECK-LABEL: define i1 @false_pinf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 false
;
%cmp = fcmp false half %x, 0xH7c00
ret i1 %cmp
}
define i1 @ord_ninf(half %x) {
; CHECK-LABEL: define i1 @ord_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp ord half %x, 0xHfc00
ret i1 %cmp
}
define i1 @uno_ninf(half %x) {
; CHECK-LABEL: define i1 @uno_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp uno half [[X]], 0.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp uno half %x, 0xHfc00
ret i1 %cmp
}
define i1 @true_ninf(half %x) {
; CHECK-LABEL: define i1 @true_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 true
;
%cmp = fcmp true half %x, 0xHfc00
ret i1 %cmp
}
define i1 @false_ninf(half %x) {
; CHECK-LABEL: define i1 @false_ninf(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: ret i1 false
;
%cmp = fcmp false half %x, 0xHfc00
ret i1 %cmp
}
define i1 @olt_one(half %x) {
; CHECK-LABEL: define i1 @olt_one(
; CHECK-SAME: half [[X:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = fcmp olt half [[X]], 1.000000e+00
; CHECK-NEXT: ret i1 [[CMP]]
;
%cmp = fcmp olt half %x, 1.0
ret i1 %cmp
}