Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/Inline/AArch64/flatten-sme.ll
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

92 lines
2.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+sme -S -passes=always-inline | FileCheck %s --check-prefixes=CHECK,ALWAYS
; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+sme -S -passes=inline | FileCheck %s --check-prefixes=CHECK,INLINE
; Test that flatten attribute respects ABI restrictions for SME.
; Streaming callee cannot be inlined into non-streaming caller.
; new_za callee cannot be inlined at all.
define internal i32 @streaming_callee() "aarch64_pstate_sm_enabled" {
; CHECK-LABEL: define internal i32 @streaming_callee(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: ret i32 42
;
ret i32 42
}
define internal i32 @new_za_callee() "aarch64_new_za" {
; CHECK-LABEL: define internal i32 @new_za_callee(
; CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: ret i32 100
;
ret i32 100
}
define internal i32 @normal_callee() {
; ALWAYS-LABEL: define internal i32 @normal_callee(
; ALWAYS-SAME: ) #[[ATTR2:[0-9]+]] {
; ALWAYS-NEXT: ret i32 50
;
ret i32 50
}
; Streaming callee -> non-streaming caller: should NOT be inlined (ABI violation).
define i32 @test_streaming_not_inlined() flatten {
; ALWAYS-LABEL: define i32 @test_streaming_not_inlined(
; ALWAYS-SAME: ) #[[ATTR3:[0-9]+]] {
; ALWAYS-NEXT: [[R:%.*]] = call i32 @streaming_callee()
; ALWAYS-NEXT: ret i32 [[R]]
;
; INLINE-LABEL: define i32 @test_streaming_not_inlined(
; INLINE-SAME: ) #[[ATTR2:[0-9]+]] {
; INLINE-NEXT: [[R:%.*]] = call i32 @streaming_callee()
; INLINE-NEXT: ret i32 [[R]]
;
%r = call i32 @streaming_callee()
ret i32 %r
}
; new_za callee: should NOT be inlined (ABI violation - callee allocates new ZA).
define i32 @test_new_za_not_inlined() flatten {
; ALWAYS-LABEL: define i32 @test_new_za_not_inlined(
; ALWAYS-SAME: ) #[[ATTR3]] {
; ALWAYS-NEXT: [[R:%.*]] = call i32 @new_za_callee()
; ALWAYS-NEXT: ret i32 [[R]]
;
; INLINE-LABEL: define i32 @test_new_za_not_inlined(
; INLINE-SAME: ) #[[ATTR2]] {
; INLINE-NEXT: [[R:%.*]] = call i32 @new_za_callee()
; INLINE-NEXT: ret i32 [[R]]
;
%r = call i32 @new_za_callee()
ret i32 %r
}
; Streaming caller -> streaming callee: should be inlined (compatible).
define i32 @test_streaming_to_streaming() flatten "aarch64_pstate_sm_enabled" {
; ALWAYS-LABEL: define i32 @test_streaming_to_streaming(
; ALWAYS-SAME: ) #[[ATTR4:[0-9]+]] {
; ALWAYS-NEXT: ret i32 42
;
; INLINE-LABEL: define i32 @test_streaming_to_streaming(
; INLINE-SAME: ) #[[ATTR3:[0-9]+]] {
; INLINE-NEXT: ret i32 42
;
%r = call i32 @streaming_callee()
ret i32 %r
}
; Non-streaming caller -> non-streaming callee: should be inlined.
define i32 @test_normal_inlined() flatten {
; ALWAYS-LABEL: define i32 @test_normal_inlined(
; ALWAYS-SAME: ) #[[ATTR3]] {
; ALWAYS-NEXT: ret i32 50
;
; INLINE-LABEL: define i32 @test_normal_inlined(
; INLINE-SAME: ) #[[ATTR2]] {
; INLINE-NEXT: ret i32 50
;
%r = call i32 @normal_callee()
ret i32 %r
}