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
84 lines
2.3 KiB
LLVM
84 lines
2.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
define i8 @and_sub(i8 %a) {
|
|
; CHECK-LABEL: @and_sub(
|
|
; CHECK-NEXT: [[RET:%.*]] = and i8 [[A:%.*]], 12
|
|
; CHECK-NEXT: ret i8 [[RET]]
|
|
;
|
|
%and1 = and i8 %a, 15
|
|
%and2 = and i8 %a, 3
|
|
|
|
%ret = sub i8 %and1, %and2
|
|
ret i8 %ret
|
|
}
|
|
|
|
declare void @use(i8)
|
|
define i8 @and_sub_multi_use(i8 %a) {
|
|
; CHECK-LABEL: @and_sub_multi_use(
|
|
; CHECK-NEXT: [[AND1:%.*]] = and i8 [[A:%.*]], 15
|
|
; CHECK-NEXT: call void @use(i8 [[AND1]])
|
|
; CHECK-NEXT: [[AND2:%.*]] = and i8 [[A]], 3
|
|
; CHECK-NEXT: call void @use(i8 [[AND2]])
|
|
; CHECK-NEXT: [[RET:%.*]] = and i8 [[A]], 12
|
|
; CHECK-NEXT: ret i8 [[RET]]
|
|
;
|
|
%and1 = and i8 %a, 15
|
|
call void @use(i8 %and1)
|
|
%and2 = and i8 %a, 3
|
|
call void @use(i8 %and2)
|
|
%ret = sub i8 %and1, %and2
|
|
ret i8 %ret
|
|
}
|
|
|
|
define <2 x i32> @and_sub_vec(<2 x i32> %a) {
|
|
; CHECK-LABEL: @and_sub_vec(
|
|
; CHECK-NEXT: [[RET:%.*]] = and <2 x i32> [[A:%.*]], <i32 3, i32 8>
|
|
; CHECK-NEXT: ret <2 x i32> [[RET]]
|
|
;
|
|
%and1 = and <2 x i32> %a, <i32 11, i32 10>
|
|
%and2 = and <2 x i32> %a, <i32 8, i32 2>
|
|
|
|
%ret = sub <2 x i32> %and1, %and2
|
|
ret <2 x i32> %ret
|
|
}
|
|
|
|
define <2 x i32> @and_sub_vec_posion(<2 x i32> %a) {
|
|
; CHECK-LABEL: @and_sub_vec_posion(
|
|
; CHECK-NEXT: ret <2 x i32> poison
|
|
;
|
|
%and1 = and <2 x i32> %a, <i32 11, i32 poison>
|
|
%and2 = and <2 x i32> %a, <i32 poison, i32 2>
|
|
|
|
%ret = sub <2 x i32> %and1, %and2
|
|
ret <2 x i32> %ret
|
|
}
|
|
|
|
define <2 x i32> @and_sub_vec_undef(<2 x i32> %a) {
|
|
; CHECK-LABEL: @and_sub_vec_undef(
|
|
; CHECK-NEXT: [[AND1:%.*]] = and <2 x i32> [[A:%.*]], <i32 11, i32 undef>
|
|
; CHECK-NEXT: [[AND2:%.*]] = and <2 x i32> [[A]], <i32 undef, i32 2>
|
|
; CHECK-NEXT: [[RET:%.*]] = sub <2 x i32> [[AND1]], [[AND2]]
|
|
; CHECK-NEXT: ret <2 x i32> [[RET]]
|
|
;
|
|
%and1 = and <2 x i32> %a, <i32 11, i32 undef>
|
|
%and2 = and <2 x i32> %a, <i32 undef, i32 2>
|
|
|
|
%ret = sub <2 x i32> %and1, %and2
|
|
ret <2 x i32> %ret
|
|
}
|
|
|
|
define i8 @and_sub_negtive(i8 %a) {
|
|
; CHECK-LABEL: @and_sub_negtive(
|
|
; CHECK-NEXT: [[AND1:%.*]] = and i8 [[A:%.*]], 10
|
|
; CHECK-NEXT: [[AND2:%.*]] = and i8 [[A]], 9
|
|
; CHECK-NEXT: [[RET:%.*]] = sub nsw i8 [[AND1]], [[AND2]]
|
|
; CHECK-NEXT: ret i8 [[RET]]
|
|
;
|
|
%and1 = and i8 %a, 10
|
|
%and2 = and i8 %a, 9
|
|
|
|
%ret = sub i8 %and1, %and2
|
|
ret i8 %ret
|
|
}
|