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

184 lines
5.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define i1 @or_fcmp_redundant_or1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or1(
; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_or2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or2(
; CHECK-NEXT: [[V1:%.*]] = fcmp olt double [[V0:%.*]], 2.300000e+00
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp olt double %v0, 2.300000e+00
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_or3(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or3(
; CHECK-NEXT: [[V1:%.*]] = fcmp ogt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_or4(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or4(
; CHECK-NEXT: [[V2:%.*]] = fcmp ogt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp ogt double %v0, 2.300000e+00
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_or_neg1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or_neg1(
; CHECK-NEXT: [[V1:%.*]] = fcmp olt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: [[V2:%.*]] = fcmp ogt double [[V0]], 1.990000e+00
; CHECK-NEXT: [[V3:%.*]] = or i1 [[V1]], [[V2]]
; CHECK-NEXT: ret i1 [[V3]]
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_or_neg2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_or_neg2(
; CHECK-NEXT: [[V1:%.*]] = fcmp ogt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[V0]], 1.990000e+00
; CHECK-NEXT: [[V3:%.*]] = or i1 [[V1]], [[V2]]
; CHECK-NEXT: ret i1 [[V3]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = or i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and1(
; CHECK-NEXT: [[V1:%.*]] = fcmp olt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and2(
; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp olt double %v0, 2.300000e+00
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and3(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and3(
; CHECK-NEXT: [[V2:%.*]] = fcmp ogt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and4(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and4(
; CHECK-NEXT: [[V1:%.*]] = fcmp ogt double [[V0:%.*]], 2.300000e+00
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp ogt double %v0, 2.300000e+00
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and_neg1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and_neg1(
; CHECK-NEXT: ret i1 false
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_and_neg2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_and_neg2(
; CHECK-NEXT: [[V1:%.*]] = fcmp ogt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[V0]], 1.990000e+00
; CHECK-NEXT: [[V3:%.*]] = and i1 [[V1]], [[V2]]
; CHECK-NEXT: ret i1 [[V3]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = and i1 %v1, %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_select_or1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_select_or1(
; CHECK-NEXT: [[V1:%.*]] = fcmp olt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = select i1 %v1, i1 %v2, i1 false
ret i1 %v3
}
define i1 @or_fcmp_redundant_select_or2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_select_or2(
; CHECK-NEXT: [[V2:%.*]] = fcmp ogt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = select i1 %v1, i1 %v2, i1 false
ret i1 %v3
}
define i1 @or_fcmp_redundant_select_and1(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_select_and1(
; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[V0:%.*]], 1.990000e+00
; CHECK-NEXT: ret i1 [[V2]]
;
%v1 = fcmp olt double %v0, 1.000000e-02
%v2 = fcmp olt double %v0, 1.990000e+00
%v3 = select i1 %v1, i1 true, i1 %v2
ret i1 %v3
}
define i1 @or_fcmp_redundant_select_and2(double %v0) {
; CHECK-LABEL: @or_fcmp_redundant_select_and2(
; CHECK-NEXT: [[V1:%.*]] = fcmp ogt double [[V0:%.*]], 1.000000e-02
; CHECK-NEXT: ret i1 [[V1]]
;
%v1 = fcmp ogt double %v0, 1.000000e-02
%v2 = fcmp ogt double %v0, 1.990000e+00
%v3 = select i1 %v1, i1 true, i1 %v2
ret i1 %v3
}