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

244 lines
9.2 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s --check-prefixes=CHECK,CHECK-PRE
# RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs %s | FileCheck %s --check-prefixes=CHECK,CHECK-POST
---
name: test_combine_trunc_select
legalized: true
body: |
bb.1:
; CHECK-PRE-LABEL: name: test_combine_trunc_select
; CHECK-PRE: %cond:_(s32) = COPY $w0
; CHECK-PRE-NEXT: %lhs:_(s64) = COPY $x0
; CHECK-PRE-NEXT: %rhs:_(s64) = COPY $x0
; CHECK-PRE-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %lhs(s64)
; CHECK-PRE-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %rhs(s64)
; CHECK-PRE-NEXT: %small:_(s32) = G_SELECT %cond(s32), [[TRUNC]], [[TRUNC1]]
; CHECK-PRE-NEXT: $w0 = COPY %small(s32)
;
; CHECK-POST-LABEL: name: test_combine_trunc_select
; CHECK-POST: %cond:_(s32) = COPY $w0
; CHECK-POST-NEXT: %lhs:_(s64) = COPY $x0
; CHECK-POST-NEXT: %rhs:_(s64) = COPY $x0
; CHECK-POST-NEXT: %res:_(s64) = G_SELECT %cond(s32), %lhs, %rhs
; CHECK-POST-NEXT: %small:_(s32) = G_TRUNC %res(s64)
; CHECK-POST-NEXT: $w0 = COPY %small(s32)
%cond:_(s32) = COPY $w0
%lhs:_(s64) = COPY $x0
%rhs:_(s64) = COPY $x0
%res:_(s64) = G_SELECT %cond(s32), %lhs, %rhs
%small:_(s32) = G_TRUNC %res(s64)
$w0 = COPY %small(s32)
...
---
name: test_combine_zext_select
legalized: true
body: |
bb.1:
; CHECK-PRE-LABEL: name: test_combine_zext_select
; CHECK-PRE: %cond:_(s32) = COPY $w0
; CHECK-PRE-NEXT: %lhs:_(s32) = COPY $w0
; CHECK-PRE-NEXT: %rhs:_(s32) = COPY $w0
; CHECK-PRE-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT %lhs(s32)
; CHECK-PRE-NEXT: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT %rhs(s32)
; CHECK-PRE-NEXT: %big:_(s64) = G_SELECT %cond(s32), [[ZEXT]], [[ZEXT1]]
; CHECK-PRE-NEXT: $x0 = COPY %big(s64)
;
; CHECK-POST-LABEL: name: test_combine_zext_select
; CHECK-POST: %cond:_(s32) = COPY $w0
; CHECK-POST-NEXT: %lhs:_(s32) = COPY $w0
; CHECK-POST-NEXT: %rhs:_(s32) = COPY $w0
; CHECK-POST-NEXT: %res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
; CHECK-POST-NEXT: %big:_(s64) = G_ZEXT %res(s32)
; CHECK-POST-NEXT: $x0 = COPY %big(s64)
%cond:_(s32) = COPY $w0
%lhs:_(s32) = COPY $w0
%rhs:_(s32) = COPY $w0
%res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
%big:_(s64) = G_ZEXT %res(s32)
$x0 = COPY %big(s64)
...
---
name: test_combine_anyzext_select
legalized: true
body: |
bb.1:
; CHECK-PRE-LABEL: name: test_combine_anyzext_select
; CHECK-PRE: %cond:_(s32) = COPY $w0
; CHECK-PRE-NEXT: %lhs:_(s32) = COPY $w0
; CHECK-PRE-NEXT: %rhs:_(s32) = COPY $w0
; CHECK-PRE-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT %lhs(s32)
; CHECK-PRE-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT %rhs(s32)
; CHECK-PRE-NEXT: %big:_(s64) = G_SELECT %cond(s32), [[ANYEXT]], [[ANYEXT1]]
; CHECK-PRE-NEXT: $x0 = COPY %big(s64)
;
; CHECK-POST-LABEL: name: test_combine_anyzext_select
; CHECK-POST: %cond:_(s32) = COPY $w0
; CHECK-POST-NEXT: %lhs:_(s32) = COPY $w0
; CHECK-POST-NEXT: %rhs:_(s32) = COPY $w0
; CHECK-POST-NEXT: %res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
; CHECK-POST-NEXT: %big:_(s64) = G_ANYEXT %res(s32)
; CHECK-POST-NEXT: $x0 = COPY %big(s64)
%cond:_(s32) = COPY $w0
%lhs:_(s32) = COPY $w0
%rhs:_(s32) = COPY $w0
%res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
%big:_(s64) = G_ANYEXT %res(s32)
$x0 = COPY %big(s64)
...
---
name: test_combine_anyzext_select_multi_use
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_anyzext_select_multi_use
; CHECK: %cond:_(s32) = COPY $w0
; CHECK-NEXT: %lhs:_(s32) = COPY $w0
; CHECK-NEXT: %rhs:_(s32) = COPY $w0
; CHECK-NEXT: %res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
; CHECK-NEXT: %big:_(s64) = G_ANYEXT %res(s32)
; CHECK-NEXT: $x0 = COPY %big(s64)
; CHECK-NEXT: $w0 = COPY %res(s32)
%cond:_(s32) = COPY $w0
%lhs:_(s32) = COPY $w0
%rhs:_(s32) = COPY $w0
%res:_(s32) = G_SELECT %cond(s32), %lhs, %rhs
%big:_(s64) = G_ANYEXT %res(s32)
$x0 = COPY %big(s64)
$w0 = COPY %res(s32)
...
---
name: test_combine_trunc_select_vector_out_of_budget
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_trunc_select_vector_out_of_budget
; CHECK: %cond:_(<2 x s32>) = COPY $x0
; CHECK-NEXT: %arg1:_(s64) = COPY $x0
; CHECK-NEXT: %arg2:_(s64) = COPY $x0
; CHECK-NEXT: %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
; CHECK-NEXT: %bv2:_(<2 x s64>) = G_BUILD_VECTOR %arg2(s64), %arg1(s64)
; CHECK-NEXT: %res:_(<2 x s64>) = G_SELECT %cond(<2 x s32>), %bv, %bv2
; CHECK-NEXT: %small:_(<2 x s32>) = G_TRUNC %res(<2 x s64>)
; CHECK-NEXT: $x0 = COPY %small(<2 x s32>)
%cond:_(<2 x s32>) = COPY $x0
%arg1:_(s64) = COPY $x0
%arg2:_(s64) = COPY $x0
%bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
%bv2:_(<2 x s64>) = G_BUILD_VECTOR %arg2(s64), %arg1(s64)
%res:_(<2 x s64>) = G_SELECT %cond(<2 x s32>), %bv, %bv2
%small:_(<2 x s32>) = G_TRUNC %res(<2 x s64>)
$x0 = COPY %small(<2 x s32>)
...
---
name: test_combine_trunc_build_vector
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_trunc_build_vector
; CHECK: %arg1:_(s64) = COPY $x0
; CHECK-NEXT: %arg2:_(s64) = COPY $x0
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %arg1(s64)
; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %arg2(s64)
; CHECK-NEXT: %small:_(<2 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32)
; CHECK-NEXT: $x0 = COPY %small(<2 x s32>)
%arg1:_(s64) = COPY $x0
%arg2:_(s64) = COPY $x0
%bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
%small:_(<2 x s32>) = G_TRUNC %bv(<2 x s64>)
$x0 = COPY %small(<2 x s32>)
...
---
name: test_combine_zext_build_vector
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_zext_build_vector
; CHECK: %arg1:_(s32) = COPY $w0
; CHECK-NEXT: %arg2:_(s32) = COPY $w0
; CHECK-NEXT: %bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
; CHECK-NEXT: %large:_(<2 x s64>) = G_ZEXT %bv(<2 x s32>)
; CHECK-NEXT: $q0 = COPY %large(<2 x s64>)
%arg1:_(s32) = COPY $w0
%arg2:_(s32) = COPY $w0
%bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
%large:_(<2 x s64>) = G_ZEXT %bv(<2 x s32>)
$q0 = COPY %large(<2 x s64>)
...
---
name: test_combine_anyext_build_vector
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_anyext_build_vector
; CHECK: %arg1:_(s32) = COPY $w0
; CHECK-NEXT: %arg2:_(s32) = COPY $w0
; CHECK-NEXT: %bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
; CHECK-NEXT: %large:_(<2 x s64>) = G_ANYEXT %bv(<2 x s32>)
; CHECK-NEXT: $q0 = COPY %large(<2 x s64>)
%arg1:_(s32) = COPY $w0
%arg2:_(s32) = COPY $w0
%bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
%large:_(<2 x s64>) = G_ANYEXT %bv(<2 x s32>)
$q0 = COPY %large(<2 x s64>)
...
---
name: test_combine_sext_build_vector
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_sext_build_vector
; CHECK: %arg1:_(s32) = COPY $w0
; CHECK-NEXT: %arg2:_(s32) = COPY $w0
; CHECK-NEXT: %bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
; CHECK-NEXT: %large:_(<2 x s64>) = G_SEXT %bv(<2 x s32>)
; CHECK-NEXT: $q0 = COPY %large(<2 x s64>)
%arg1:_(s32) = COPY $w0
%arg2:_(s32) = COPY $w0
%bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
%large:_(<2 x s64>) = G_SEXT %bv(<2 x s32>)
$q0 = COPY %large(<2 x s64>)
...
---
name: test_combine_anyext_build_vector_multi_use
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_combine_anyext_build_vector_multi_use
; CHECK: %arg1:_(s32) = COPY $w0
; CHECK-NEXT: %arg2:_(s32) = COPY $w0
; CHECK-NEXT: %bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
; CHECK-NEXT: %large:_(<2 x s64>) = G_ANYEXT %bv(<2 x s32>)
; CHECK-NEXT: $q0 = COPY %large(<2 x s64>)
; CHECK-NEXT: $d0 = COPY %bv(<2 x s32>)
%arg1:_(s32) = COPY $w0
%arg2:_(s32) = COPY $w0
%bv:_(<2 x s32>) = G_BUILD_VECTOR %arg1(s32), %arg2(s32)
%large:_(<2 x s64>) = G_ANYEXT %bv(<2 x s32>)
$q0 = COPY %large(<2 x s64>)
$d0 = COPY %bv(<2 x s32>)
...
---
name: test_undef_ptrtoint
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_undef_ptrtoint
; CHECK: [[DEF:%[0-9]+]]:_(<2 x s64>) = G_IMPLICIT_DEF
; CHECK-NEXT: $q0 = COPY [[DEF]](<2 x s64>)
%0:_(<2 x p0>) = G_IMPLICIT_DEF
%1:_(<2 x s64>) = G_PTRTOINT %0(<2 x p0>)
$q0 = COPY %1(<2 x s64>)
...
---
name: test_undef_inttoptr
legalized: true
body: |
bb.1:
; CHECK-LABEL: name: test_undef_inttoptr
; CHECK: [[DEF:%[0-9]+]]:_(<2 x p0>) = G_IMPLICIT_DEF
; CHECK-NEXT: $q0 = COPY [[DEF]](<2 x p0>)
%0:_(<2 x s64>) = G_IMPLICIT_DEF
%1:_(<2 x p0>) = G_INTTOPTR %0(<2 x s64>)
$q0 = COPY %1(<2 x p0>)