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
87 lines
2.7 KiB
LLVM
87 lines
2.7 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
;
|
|
; This test makes sure that InstCombine does not replace the sequence of
|
|
; xor/sub instruction followed by cmp instruction into a single cmp instruction
|
|
; if there is more than one use of xor/sub.
|
|
|
|
define zeroext i1 @test1(i32 %lhs, i32 %rhs) {
|
|
; CHECK-LABEL: @test1(
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[LHS:%.*]], 15
|
|
; CHECK-NEXT: [[TMP1:%.*]] = xor i32 [[LHS]], [[RHS:%.*]]
|
|
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 [[TMP1]], 5
|
|
; CHECK-NEXT: [[SEL:%.*]] = or i1 [[CMP1]], [[CMP2]]
|
|
; CHECK-NEXT: ret i1 [[SEL]]
|
|
;
|
|
|
|
%xor = xor i32 %lhs, 5
|
|
%cmp1 = icmp eq i32 %xor, 10
|
|
%cmp2 = icmp eq i32 %xor, %rhs
|
|
%sel = or i1 %cmp1, %cmp2
|
|
ret i1 %sel
|
|
}
|
|
|
|
define zeroext i1 @test1_logical(i32 %lhs, i32 %rhs) {
|
|
; CHECK-LABEL: @test1_logical(
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[LHS:%.*]], 15
|
|
; CHECK-NEXT: [[TMP1:%.*]] = xor i32 [[LHS]], [[RHS:%.*]]
|
|
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 [[TMP1]], 5
|
|
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP1]], i1 true, i1 [[CMP2]]
|
|
; CHECK-NEXT: ret i1 [[SEL]]
|
|
;
|
|
|
|
%xor = xor i32 %lhs, 5
|
|
%cmp1 = icmp eq i32 %xor, 10
|
|
%cmp2 = icmp eq i32 %xor, %rhs
|
|
%sel = select i1 %cmp1, i1 true, i1 %cmp2
|
|
ret i1 %sel
|
|
}
|
|
|
|
define zeroext i1 @test2(i32 %lhs, i32 %rhs) {
|
|
; CHECK-LABEL: @test2(
|
|
; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[LHS:%.*]], [[RHS:%.*]]
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[LHS]], [[RHS]]
|
|
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 [[XOR]], 32
|
|
; CHECK-NEXT: [[SEL:%.*]] = xor i1 [[CMP1]], [[CMP2]]
|
|
; CHECK-NEXT: ret i1 [[SEL]]
|
|
;
|
|
|
|
%xor = xor i32 %lhs, %rhs
|
|
%cmp1 = icmp eq i32 %xor, 0
|
|
%cmp2 = icmp eq i32 %xor, 32
|
|
%sel = xor i1 %cmp1, %cmp2
|
|
ret i1 %sel
|
|
}
|
|
|
|
define zeroext i1 @test3(i32 %lhs, i32 %rhs) {
|
|
; CHECK-LABEL: @test3(
|
|
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 [[LHS:%.*]], [[RHS:%.*]]
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[LHS]], [[RHS]]
|
|
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 [[SUB]], 31
|
|
; CHECK-NEXT: [[SEL:%.*]] = or i1 [[CMP1]], [[CMP2]]
|
|
; CHECK-NEXT: ret i1 [[SEL]]
|
|
;
|
|
|
|
%sub = sub nsw i32 %lhs, %rhs
|
|
%cmp1 = icmp eq i32 %sub, 0
|
|
%cmp2 = icmp eq i32 %sub, 31
|
|
%sel = or i1 %cmp1, %cmp2
|
|
ret i1 %sel
|
|
}
|
|
|
|
define zeroext i1 @test3_logical(i32 %lhs, i32 %rhs) {
|
|
; CHECK-LABEL: @test3_logical(
|
|
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 [[LHS:%.*]], [[RHS:%.*]]
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[LHS]], [[RHS]]
|
|
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 [[SUB]], 31
|
|
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP1]], i1 true, i1 [[CMP2]]
|
|
; CHECK-NEXT: ret i1 [[SEL]]
|
|
;
|
|
|
|
%sub = sub nsw i32 %lhs, %rhs
|
|
%cmp1 = icmp eq i32 %sub, 0
|
|
%cmp2 = icmp eq i32 %sub, 31
|
|
%sel = select i1 %cmp1, i1 true, i1 %cmp2
|
|
ret i1 %sel
|
|
}
|