Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-bzero.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

163 lines
5.8 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64-apple-ios -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=DARWIN
# RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=UNKNOWN
#
# Check that on Darwin we can combine to G_BZERO. Without Darwin, this should
# stay as memset.
--- |
define void @bzero_unknown_width() { unreachable }
define void @bzero_tail_unknown_width() { unreachable }
define void @bzero_constant_width() { unreachable }
define void @bzero_constant_width_minsize() minsize { unreachable }
define void @not_zero() minsize { unreachable }
...
---
name: bzero_unknown_width
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0, $x1
; Always use G_BZERO when the memset width is unknown on Darwin.
; DARWIN-LABEL: name: bzero_unknown_width
; DARWIN: liveins: $x0, $x1
; DARWIN-NEXT: {{ $}}
; DARWIN-NEXT: %ptr:_(p0) = COPY $x0
; DARWIN-NEXT: %width:_(s64) = COPY $x1
; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))
; DARWIN-NEXT: RET_ReallyLR
;
; UNKNOWN-LABEL: name: bzero_unknown_width
; UNKNOWN: liveins: $x0, $x1
; UNKNOWN-NEXT: {{ $}}
; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0
; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 0
; UNKNOWN-NEXT: %width:_(s64) = COPY $x1
; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
; UNKNOWN-NEXT: RET_ReallyLR
%ptr:_(p0) = COPY $x0
%zero:_(s8) = G_CONSTANT i8 0
%width:_(s64) = COPY $x1
G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
RET_ReallyLR
...
---
name: bzero_tail_unknown_width
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0, $x1
; DARWIN-LABEL: name: bzero_tail_unknown_width
; DARWIN: liveins: $x0, $x1
; DARWIN-NEXT: {{ $}}
; DARWIN-NEXT: %ptr:_(p0) = COPY $x0
; DARWIN-NEXT: %width:_(s64) = COPY $x1
; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 1 :: (store (s32))
; DARWIN-NEXT: RET_ReallyLR
;
; UNKNOWN-LABEL: name: bzero_tail_unknown_width
; UNKNOWN: liveins: $x0, $x1
; UNKNOWN-NEXT: {{ $}}
; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0
; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 0
; UNKNOWN-NEXT: %width:_(s64) = COPY $x1
; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 1 :: (store (s32))
; UNKNOWN-NEXT: RET_ReallyLR
%ptr:_(p0) = COPY $x0
%zero:_(s8) = G_CONSTANT i8 0
%width:_(s64) = COPY $x1
G_MEMSET %ptr(p0), %zero(s8), %width(s64), 1 :: (store (s32))
RET_ReallyLR
...
---
name: bzero_constant_width
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0, $x1
; For values >256, we should use G_BZERO on Darwin.
; DARWIN-LABEL: name: bzero_constant_width
; DARWIN: liveins: $x0, $x1
; DARWIN-NEXT: {{ $}}
; DARWIN-NEXT: %ptr:_(p0) = COPY $x0
; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 1024
; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))
; DARWIN-NEXT: RET_ReallyLR
;
; UNKNOWN-LABEL: name: bzero_constant_width
; UNKNOWN: liveins: $x0, $x1
; UNKNOWN-NEXT: {{ $}}
; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0
; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 0
; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 1024
; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
; UNKNOWN-NEXT: RET_ReallyLR
%ptr:_(p0) = COPY $x0
%zero:_(s8) = G_CONSTANT i8 0
%width:_(s64) = G_CONSTANT i64 1024
G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
RET_ReallyLR
...
---
name: bzero_constant_width_minsize
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0, $x1
; With minsize, we should always use G_BZERO to avoid a copy from wzr.
; DARWIN-LABEL: name: bzero_constant_width_minsize
; DARWIN: liveins: $x0, $x1
; DARWIN-NEXT: {{ $}}
; DARWIN-NEXT: %ptr:_(p0) = COPY $x0
; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 256
; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))
; DARWIN-NEXT: RET_ReallyLR
;
; UNKNOWN-LABEL: name: bzero_constant_width_minsize
; UNKNOWN: liveins: $x0, $x1
; UNKNOWN-NEXT: {{ $}}
; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0
; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 0
; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 256
; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
; UNKNOWN-NEXT: RET_ReallyLR
%ptr:_(p0) = COPY $x0
%zero:_(s8) = G_CONSTANT i8 0
%width:_(s64) = G_CONSTANT i64 256
G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))
RET_ReallyLR
...
---
name: not_zero
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0, $x1
; When the value isn't 0, don't create G_BZERO.
; DARWIN-LABEL: name: not_zero
; DARWIN: liveins: $x0, $x1
; DARWIN-NEXT: {{ $}}
; DARWIN-NEXT: %ptr:_(p0) = COPY $x0
; DARWIN-NEXT: %not_zero:_(s8) = G_CONSTANT i8 1
; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 256
; DARWIN-NEXT: G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))
; DARWIN-NEXT: RET_ReallyLR
;
; UNKNOWN-LABEL: name: not_zero
; UNKNOWN: liveins: $x0, $x1
; UNKNOWN-NEXT: {{ $}}
; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0
; UNKNOWN-NEXT: %not_zero:_(s8) = G_CONSTANT i8 1
; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 256
; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))
; UNKNOWN-NEXT: RET_ReallyLR
%ptr:_(p0) = COPY $x0
%not_zero:_(s8) = G_CONSTANT i8 1
%width:_(s64) = G_CONSTANT i64 256
G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))
RET_ReallyLR