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
184 lines
5.7 KiB
YAML
184 lines
5.7 KiB
YAML
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
|
|
# RUN: llc -mtriple aarch64 -debugify-and-strip-all-safe -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
|
|
|
|
...
|
|
---
|
|
name: fold_scalar
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1
|
|
; (xor (and x, y), y) -> (and (not x), y)
|
|
; CHECK-LABEL: name: fold_scalar
|
|
; CHECK: liveins: $w0, $w1
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
|
|
; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %x, [[C]]
|
|
; CHECK-NEXT: %xor:_(s32) = G_AND [[XOR]], %y
|
|
; CHECK-NEXT: $w0 = COPY %xor(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%and:_(s32) = G_AND %x, %y
|
|
%xor:_(s32) = G_XOR %and, %y
|
|
$w0 = COPY %xor(s32)
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|
|
---
|
|
name: fold_vector
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $x0, $x1
|
|
; Vector edition
|
|
; CHECK-LABEL: name: fold_vector
|
|
; CHECK: liveins: $x0, $x1
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(<2 x s32>) = COPY $x0
|
|
; CHECK-NEXT: %y:_(<2 x s32>) = COPY $x1
|
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
|
|
; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
|
|
; CHECK-NEXT: [[XOR:%[0-9]+]]:_(<2 x s32>) = G_XOR %x, [[BUILD_VECTOR]]
|
|
; CHECK-NEXT: %xor:_(<2 x s32>) = G_AND [[XOR]], %y
|
|
; CHECK-NEXT: $x0 = COPY %xor(<2 x s32>)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $x0
|
|
%x:_(<2 x s32>) = COPY $x0
|
|
%y:_(<2 x s32>) = COPY $x1
|
|
%and:_(<2 x s32>) = G_AND %x, %y
|
|
%xor:_(<2 x s32>) = G_XOR %and, %y
|
|
$x0 = COPY %xor(<2 x s32>)
|
|
RET_ReallyLR implicit $x0
|
|
|
|
...
|
|
---
|
|
name: fold_commuted_and
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1
|
|
; (xor (and y, x), y) -> (and (not x), y)
|
|
; CHECK-LABEL: name: fold_commuted_and
|
|
; CHECK: liveins: $w0, $w1
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
|
|
; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %x, [[C]]
|
|
; CHECK-NEXT: %xor:_(s32) = G_AND [[XOR]], %y
|
|
; CHECK-NEXT: $w0 = COPY %xor(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%and:_(s32) = G_AND %y, %x
|
|
%xor:_(s32) = G_XOR %and, %y
|
|
$w0 = COPY %xor(s32)
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|
|
---
|
|
name: fold_commuted_xor
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1
|
|
; (xor y, (and x, y)) -> (and (not x), y)
|
|
; CHECK-LABEL: name: fold_commuted_xor
|
|
; CHECK: liveins: $w0, $w1
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
|
|
; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %x, [[C]]
|
|
; CHECK-NEXT: %xor:_(s32) = G_AND [[XOR]], %y
|
|
; CHECK-NEXT: $w0 = COPY %xor(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%and:_(s32) = G_AND %x, %y
|
|
%xor:_(s32) = G_XOR %y, %and
|
|
$w0 = COPY %xor(s32)
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|
|
---
|
|
name: fold_commuted_xor_and
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1
|
|
; (xor y, (and x, y)) -> (and (not x), y)
|
|
; CHECK-LABEL: name: fold_commuted_xor_and
|
|
; CHECK: liveins: $w0, $w1
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
|
|
; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %x, [[C]]
|
|
; CHECK-NEXT: %xor:_(s32) = G_AND [[XOR]], %y
|
|
; CHECK-NEXT: $w0 = COPY %xor(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%and:_(s32) = G_AND %y, %x
|
|
%xor:_(s32) = G_XOR %y, %and
|
|
$w0 = COPY %xor(s32)
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|
|
---
|
|
name: dont_fold_different_regs
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1, $w2
|
|
; The G_AND does not share any registers with the G_XOR
|
|
; CHECK-LABEL: name: dont_fold_different_regs
|
|
; CHECK: liveins: $w0, $w1, $w2
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: %z:_(s32) = COPY $w2
|
|
; CHECK-NEXT: %and:_(s32) = G_AND %x, %z
|
|
; CHECK-NEXT: %xor:_(s32) = G_XOR %and, %y
|
|
; CHECK-NEXT: $w0 = COPY %xor(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%z:_(s32) = COPY $w2
|
|
%and:_(s32) = G_AND %x, %z
|
|
%xor:_(s32) = G_XOR %and, %y
|
|
$w0 = COPY %xor(s32)
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|
|
---
|
|
name: dont_fold_more_than_one_use
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $w0, $w1, $w2
|
|
; Don't fold when the G_AND is used outside the G_XOR.
|
|
; CHECK-LABEL: name: dont_fold_more_than_one_use
|
|
; CHECK: liveins: $w0, $w1, $w2
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %x:_(s32) = COPY $w0
|
|
; CHECK-NEXT: %y:_(s32) = COPY $w1
|
|
; CHECK-NEXT: %z:_(s32) = COPY $w2
|
|
; CHECK-NEXT: %and:_(s32) = G_AND %x, %z
|
|
; CHECK-NEXT: %xor:_(s32) = G_XOR %and, %y
|
|
; CHECK-NEXT: %add:_(s32) = G_ADD %and, %xor
|
|
; CHECK-NEXT: $w0 = COPY %add(s32)
|
|
; CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
%x:_(s32) = COPY $w0
|
|
%y:_(s32) = COPY $w1
|
|
%z:_(s32) = COPY $w2
|
|
%and:_(s32) = G_AND %x, %z
|
|
%xor:_(s32) = G_XOR %and, %y
|
|
%add:_(s32) = G_ADD %and, %xor
|
|
$w0 = COPY %add(s32)
|
|
RET_ReallyLR implicit $w0
|