Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InstSimplify/icmp-not-bool-constant.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

301 lines
8.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
; Test all integer predicates with bool types and true/false constants,
; with not on LHS (icmp pred not(X), true|false).
; Use vectors to provide test coverage that is not duplicated in other folds.
define <2 x i1> @eq_t_not(<2 x i1> %a) {
; CHECK-LABEL: @eq_t_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp eq <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @eq_f_not(<2 x i1> %a) {
; CHECK-LABEL: @eq_f_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp eq <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @eq_f_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @eq_f_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp eq <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @eq_f_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @eq_f_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp eq <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ne_t_not(<2 x i1> %a) {
; CHECK-LABEL: @ne_t_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ne <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ne_t_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @ne_t_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp ne <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ne_t_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @ne_t_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp ne <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ne_f_not(<2 x i1> %a) {
; CHECK-LABEL: @ne_f_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ne <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ugt_t_not(<2 x i1> %a) {
; CHECK-LABEL: @ugt_t_not(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ugt <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ugt_f_not(<2 x i1> %a) {
; CHECK-LABEL: @ugt_f_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ugt <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ult_t_not(<2 x i1> %a) {
; CHECK-LABEL: @ult_t_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ult <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ult_t_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @ult_t_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp ult <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ult_t_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @ult_t_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp ult <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ult_f_not(<2 x i1> %a) {
; CHECK-LABEL: @ult_f_not(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ult <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @sgt_t_not(<2 x i1> %a) {
; CHECK-LABEL: @sgt_t_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sgt <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @sgt_t_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @sgt_t_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp sgt <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @sgt_t_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @sgt_t_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp sgt <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @sgt_f_not(<2 x i1> %a) {
; CHECK-LABEL: @sgt_f_not(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sgt <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @slt_t_not(<2 x i1> %a) {
; CHECK-LABEL: @slt_t_not(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp slt <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @slt_f_not(<2 x i1> %a) {
; CHECK-LABEL: @slt_f_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp slt <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @uge_t_not(<2 x i1> %a) {
; CHECK-LABEL: @uge_t_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp uge <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @uge_f_not(<2 x i1> %a) {
; CHECK-LABEL: @uge_f_not(
; CHECK-NEXT: ret <2 x i1> splat (i1 true)
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp uge <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ule_t_not(<2 x i1> %a) {
; CHECK-LABEL: @ule_t_not(
; CHECK-NEXT: ret <2 x i1> splat (i1 true)
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ule <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @ule_f_not(<2 x i1> %a) {
; CHECK-LABEL: @ule_f_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp ule <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ule_f_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @ule_f_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp ule <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @ule_f_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @ule_f_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp ule <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @sge_t_not(<2 x i1> %a) {
; CHECK-LABEL: @sge_t_not(
; CHECK-NEXT: ret <2 x i1> splat (i1 true)
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sge <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @sge_f_not(<2 x i1> %a) {
; CHECK-LABEL: @sge_f_not(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sge <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @sge_f_not_swap(<2 x i1> %a) {
; CHECK-LABEL: @sge_f_not_swap(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> <i1 true, i1 true>, %a
%r = icmp sge <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @sge_f_not_poison(<2 x i1> %a) {
; CHECK-LABEL: @sge_f_not_poison(
; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%not = xor <2 x i1> %a, <i1 poison, i1 true>
%r = icmp sge <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}
define <2 x i1> @sle_t_not(<2 x i1> %a) {
; CHECK-LABEL: @sle_t_not(
; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> [[A:%.*]], splat (i1 true)
; CHECK-NEXT: ret <2 x i1> [[NOT]]
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sle <2 x i1> %not, <i1 true, i1 true>
ret <2 x i1> %r
}
define <2 x i1> @sle_f_not(<2 x i1> %a) {
; CHECK-LABEL: @sle_f_not(
; CHECK-NEXT: ret <2 x i1> splat (i1 true)
;
%not = xor <2 x i1> %a, <i1 true, i1 true>
%r = icmp sle <2 x i1> %not, <i1 false, i1 false>
ret <2 x i1> %r
}