Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/GlobalISel/combine-integer-ll.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

122 lines
3.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
define i64 @APlusC1MinusC2(i64 %a) {
; CHECK-LABEL: APlusC1MinusC2:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: sub x0, x0, #1
; CHECK-NEXT: ret
entry:
; fold (A+C1)-C2 -> A+(C1-C2)
%add1 = add i64 %a, 5
%sub1 = sub i64 %add1, 6
ret i64 %sub1
}
define i64 @C2MinusAPlusC1(i64 %a) {
; CHECK-LABEL: C2MinusAPlusC1:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: mov w8, #3 // =0x3
; CHECK-NEXT: sub x0, x8, x0
; CHECK-NEXT: ret
entry:
; fold C2-(A+C1) -> (C2-C1)-A
%add1 = add i64 %a, 6
%sub1 = sub i64 9, %add1
ret i64 %sub1
}
define i64 @AMinusC1MinusC2(i64 %a) {
; CHECK-LABEL: AMinusC1MinusC2:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: sub x0, x0, #15
; CHECK-NEXT: ret
entry:
; fold (A-C1)-C2 -> A-(C1+C2)
%sub2 = sub i64 %a, 6
%sub1 = sub i64 %sub2, 9
ret i64 %sub1
}
define i64 @C1Minus2MinusC2(i64 %a) {
; CHECK-LABEL: C1Minus2MinusC2:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: mov w8, #3 // =0x3
; CHECK-NEXT: sub x0, x8, x0
; CHECK-NEXT: ret
entry:
; fold (C1-A)-C2 -> (C1-C2)-A
%sub2 = sub i64 14, %a
%sub1 = sub i64 %sub2, 11
ret i64 %sub1
}
define i64 @AMinusC2PlusC2(i64 %a) {
; CHECK-LABEL: AMinusC2PlusC2:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: sub x0, x0, #4
; CHECK-NEXT: ret
entry:
; fold ((A-C1)+C2) -> (A+(C2-C1))
%sub1 = sub i64 %a, 21
%add1 = add i64 %sub1, 17
ret i64 %add1
}
define i64 @AMinusZeroMinusB(i64 %a, i64 %b) {
; CHECK-LABEL: AMinusZeroMinusB:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: add x0, x0, x1
; CHECK-NEXT: ret
entry:
; fold (A - (0 - B)) to (A + B)
%sub1 = sub i64 0, %b
%sub2 = sub i64 %a, %sub1
ret i64 %sub2
}
define <4 x i16> @AMinusZeroMinusB_vector(<4 x i16> %a, <4 x i16> %b) {
; CHECK-LABEL: AMinusZeroMinusB_vector:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: add v0.4h, v0.4h, v1.4h
; CHECK-NEXT: ret
entry:
; fold (A - (0 - B)) to (A + B)
%sub1 = sub <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %b
%sub2 = sub <4 x i16> %a, %sub1
ret <4 x i16> %sub2
}
define i64 @AMinusBMinusA(i64 %a, i64 %b) {
; CHECK-LABEL: AMinusBMinusA:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: mov x0, x1
; CHECK-NEXT: ret
entry:
; fold A - (A - B) -> B
%sub1 = sub i64 %a, %b
%sub2 = sub i64 %a, %sub1
ret i64 %sub2
}
define <4 x i16> @AMinusBMinusA_vec(<4 x i16> %a, <4 x i16> %b) {
; CHECK-LABEL: AMinusBMinusA_vec:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fmov d0, d1
; CHECK-NEXT: ret
entry:
; fold A - (A - B) -> B
%sub1 = sub <4 x i16> %a, %b
%sub2 = sub <4 x i16> %a, %sub1
ret <4 x i16> %sub2
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK-GI: {{.*}}
; CHECK-SD: {{.*}}