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
77 lines
2.0 KiB
LLVM
77 lines
2.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=aarch64-linux-gnu %s -o - | FileCheck %s
|
|
|
|
; The test cases in this file check following transformation if the right form
|
|
; can reduce latency.
|
|
; A - (B + C) ==> (A - B) - C
|
|
|
|
; 32 bit version.
|
|
define i32 @test1(i32 %a, i32 %b, i32 %c) {
|
|
; CHECK-LABEL: test1:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: add w8, w0, #100
|
|
; CHECK-NEXT: orr w9, w2, #0x80
|
|
; CHECK-NEXT: eor w10, w1, w8, lsl #8
|
|
; CHECK-NEXT: sub w8, w9, w8
|
|
; CHECK-NEXT: sub w8, w8, w10
|
|
; CHECK-NEXT: eor w0, w8, w10, asr #13
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%c1 = or i32 %c, 128
|
|
%a1 = add i32 %a, 100
|
|
%shl = shl i32 %a1, 8
|
|
%xor = xor i32 %shl, %b
|
|
%add = add i32 %xor, %a1
|
|
%sub = sub i32 %c1, %add
|
|
%shr = ashr i32 %xor, 13
|
|
%xor2 = xor i32 %sub, %shr
|
|
ret i32 %xor2
|
|
}
|
|
|
|
; 64 bit version.
|
|
define i64 @test2(i64 %a, i64 %b, i64 %c) {
|
|
; CHECK-LABEL: test2:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: add x8, x0, #100
|
|
; CHECK-NEXT: orr x9, x2, #0x80
|
|
; CHECK-NEXT: eor x10, x1, x8, lsl #8
|
|
; CHECK-NEXT: sub x8, x9, x8
|
|
; CHECK-NEXT: sub x8, x8, x10
|
|
; CHECK-NEXT: eor x0, x8, x10, asr #13
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%c1 = or i64 %c, 128
|
|
%a1 = add i64 %a, 100
|
|
%shl = shl i64 %a1, 8
|
|
%xor = xor i64 %shl, %b
|
|
%add = add i64 %xor, %a1
|
|
%sub = sub i64 %c1, %add
|
|
%shr = ashr i64 %xor, 13
|
|
%xor2 = xor i64 %sub, %shr
|
|
ret i64 %xor2
|
|
}
|
|
|
|
; Negative test. The right form can't reduce latency.
|
|
define i32 @test3(i32 %a, i32 %b, i32 %c) {
|
|
; CHECK-LABEL: test3:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: add w8, w0, #100
|
|
; CHECK-NEXT: orr w9, w2, #0x80
|
|
; CHECK-NEXT: eor w10, w1, w8, lsl #8
|
|
; CHECK-NEXT: add w8, w9, w8
|
|
; CHECK-NEXT: sub w8, w10, w8
|
|
; CHECK-NEXT: eor w0, w8, w10, asr #13
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%c1 = or i32 %c, 128
|
|
%a1 = add i32 %a, 100
|
|
%shl = shl i32 %a1, 8
|
|
%xor = xor i32 %shl, %b
|
|
%add = add i32 %c1, %a1
|
|
%sub = sub i32 %xor, %add
|
|
%shr = ashr i32 %xor, 13
|
|
%xor2 = xor i32 %sub, %shr
|
|
ret i32 %xor2
|
|
}
|
|
|