Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/GlobalISel/select-brcond-of-binop.mir
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

255 lines
6.2 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
---
name: condbr_of_not
legalized: true
regBankSelected: true
liveins:
- { reg: '$x0' }
body: |
; CHECK-LABEL: name: condbr_of_not
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $x0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
; CHECK-NEXT: [[LDRBBui:%[0-9]+]]:gpr32 = LDRBBui [[COPY]], 0 :: (load (s8))
; CHECK-NEXT: TBZW [[LDRBBui]], 0, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
bb.1:
successors: %bb.2, %bb.3
liveins: $x0
%0:gpr(p0) = COPY $x0
%8:gpr(i8) = G_LOAD %0(p0) :: (load (s8))
%4:gpr(i32) = G_ANYEXT %8(i8)
%5:gpr(i32) = G_CONSTANT i32 1
%6:gpr(i32) = G_XOR %4, %5
G_BRCOND %6, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: condbr_of_not_64
legalized: true
regBankSelected: true
liveins:
- { reg: '$x0' }
body: |
; CHECK-LABEL: name: condbr_of_not_64
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $x0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
; CHECK-NEXT: [[LDRBBui:%[0-9]+]]:gpr32 = LDRBBui [[COPY]], 0 :: (load (s8))
; CHECK-NEXT: TBZW [[LDRBBui]], 0, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
; TB(N)ZX has no encoding if the bit being tested is < 32, so we should get
; TBZW here.
bb.1:
successors: %bb.2, %bb.3
liveins: $x0
%0:gpr(p0) = COPY $x0
%8:gpr(i8) = G_LOAD %0(p0) :: (load (s8))
%4:gpr(i64) = G_ANYEXT %8(i8)
%5:gpr(i64) = G_CONSTANT i64 1
%6:gpr(i64) = G_XOR %4, %5
%3:gpr(i32) = G_TRUNC %6(i64)
G_BRCOND %3(i32), %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: condbr_of_and
legalized: true
regBankSelected: true
body: |
; CHECK-LABEL: name: condbr_of_and
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: %lhs:gpr32 = COPY $w0
; CHECK-NEXT: TBNZW %lhs, 0, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
bb.1:
successors: %bb.2, %bb.3
liveins: $w0
%lhs:gpr(i32) = COPY $w0
%rhs:gpr(i32) = G_CONSTANT i32 1
%op:gpr(i32) = G_AND %lhs, %rhs
G_BRCOND %op, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: condbr_of_and_no_cst
legalized: true
regBankSelected: true
body: |
; CHECK-LABEL: name: condbr_of_and_no_cst
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $w0, $w1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: %lhs:gpr32 = COPY $w0
; CHECK-NEXT: %rhs:gpr32 = COPY $w1
; CHECK-NEXT: %op:gpr32 = ANDWrr %lhs, %rhs
; CHECK-NEXT: TBNZW %op, 0, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
bb.1:
successors: %bb.2, %bb.3
liveins: $w0, $w1
%lhs:gpr(i32) = COPY $w0
%rhs:gpr(i32) = COPY $w1
%op:gpr(i32) = G_AND %lhs, %rhs
G_BRCOND %op, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: condbr_of_shl
legalized: true
regBankSelected: true
body: |
; CHECK-LABEL: name: condbr_of_shl
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: %lhs:gpr32 = COPY $w0
; CHECK-NEXT: %op:gpr32 = UBFMWri %lhs, 31, 30
; CHECK-NEXT: TBNZW %op, 0, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
; We won't ever fold this, because
; bit = 0
; bit - constant < 0, which isn't valid for tbz/tbnz.
bb.1:
successors: %bb.2, %bb.3
liveins: $w0
%lhs:gpr(i32) = COPY $w0
%rhs:gpr(i32) = G_CONSTANT i32 1
%op:gpr(i32) = G_SHL %lhs, %rhs
G_BRCOND %op, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: condbr_of_ashr
legalized: true
regBankSelected: true
body: |
; CHECK-LABEL: name: condbr_of_ashr
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: %lhs:gpr32 = COPY $w0
; CHECK-NEXT: TBNZW %lhs, 1, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
; We can fold ashr, because we can have
; (tbz (ashr x, c), 0) where 0 + c > # bits in x.
bb.1:
successors: %bb.2, %bb.3
liveins: $w0
%lhs:gpr(i32) = COPY $w0
%rhs:gpr(i32) = G_CONSTANT i32 1
%op:gpr(i32) = G_ASHR %lhs, %rhs
G_BRCOND %op, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...
---
name: tbnzx
legalized: true
regBankSelected: true
body: |
; CHECK-LABEL: name: tbnzx
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $x0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: %lhs:gpr64 = COPY $x0
; CHECK-NEXT: TBNZX %lhs, 63, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: RET_ReallyLR
bb.1:
successors: %bb.2, %bb.3
liveins: $x0
%lhs:gpr(i64) = COPY $x0
%rhs:gpr(i64) = G_CONSTANT i64 8589934592
%op:gpr(i64) = G_ASHR %lhs, %rhs
%trunc:gpr(i32) = G_TRUNC %op(i64)
G_BRCOND %trunc, %bb.3
bb.2:
RET_ReallyLR
bb.3:
RET_ReallyLR
...