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
70 lines
1.8 KiB
LLVM
70 lines
1.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
|
|
|
|
define i32 @negated_operand(i32 %x) {
|
|
; CHECK-LABEL: @negated_operand(
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%negx = sub i32 0, %x
|
|
%rem = srem i32 %negx, %x
|
|
ret i32 %rem
|
|
}
|
|
|
|
define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
|
|
; CHECK-LABEL: @negated_operand_commute_vec(
|
|
; CHECK-NEXT: ret <2 x i32> zeroinitializer
|
|
;
|
|
%negx = sub <2 x i32> zeroinitializer, %x
|
|
%rem = srem <2 x i32> %negx, %x
|
|
ret <2 x i32> %rem
|
|
}
|
|
|
|
define i32 @knownnegation(i32 %x, i32 %y) {
|
|
; CHECK-LABEL: @knownnegation(
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%xy = sub i32 %x, %y
|
|
%yx = sub i32 %y, %x
|
|
%rem = srem i32 %xy, %yx
|
|
ret i32 %rem
|
|
}
|
|
|
|
define <2 x i32> @knownnegation_commute_vec(<2 x i32> %x, <2 x i32> %y) {
|
|
; CHECK-LABEL: @knownnegation_commute_vec(
|
|
; CHECK-NEXT: ret <2 x i32> zeroinitializer
|
|
;
|
|
%xy = sub <2 x i32> %x, %y
|
|
%yx = sub <2 x i32> %y, %x
|
|
%rem = srem <2 x i32> %xy, %yx
|
|
ret <2 x i32> %rem
|
|
}
|
|
|
|
define <3 x i32> @negated_operand_vec_poison(<3 x i32> %x) {
|
|
; CHECK-LABEL: @negated_operand_vec_poison(
|
|
; CHECK-NEXT: ret <3 x i32> zeroinitializer
|
|
;
|
|
%negx = sub <3 x i32> <i32 0, i32 poison, i32 0>, %x
|
|
%rem = srem <3 x i32> %negx, %x
|
|
ret <3 x i32> %rem
|
|
}
|
|
|
|
define <2 x i32> @negated_operand_vec_nonsplat(<2 x i32> %x) {
|
|
; CHECK-LABEL: @negated_operand_vec_nonsplat(
|
|
; CHECK-NEXT: [[NEGX:%.*]] = sub <2 x i32> <i32 0, i32 1>, [[X:%.*]]
|
|
; CHECK-NEXT: [[REM:%.*]] = srem <2 x i32> [[NEGX]], [[X]]
|
|
; CHECK-NEXT: ret <2 x i32> [[REM]]
|
|
;
|
|
%negx = sub <2 x i32> <i32 0, i32 1>, %x ; not 0, don't fold
|
|
%rem = srem <2 x i32> %negx, %x
|
|
ret <2 x i32> %rem
|
|
}
|
|
|
|
define i32 @negated_operand_commute(i32 %x) {
|
|
; CHECK-LABEL: @negated_operand_commute(
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%negx = sub i32 0, %x
|
|
%rem = srem i32 %x, %negx
|
|
ret i32 %rem
|
|
}
|