48 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+sme -S -passes=inline -inlinedefault-threshold=1 | FileCheck %s3 4; This test sets the inline-threshold to 1 such that by default the call to @streaming_callee is not inlined.5; However, if the call to @streaming_callee requires a streaming-mode change, it should always inline the call because the streaming-mode change is more expensive.6target triple = "aarch64"7 8declare void @streaming_compatible_f() #0 "aarch64_pstate_sm_compatible"9 10; Function @non_streaming_callee doesn't contain any operations that may use ZA11; state and therefore can be legally inlined into a normal function.12define void @non_streaming_callee() #0 {13; CHECK-LABEL: define void @non_streaming_callee14; CHECK-SAME: () #[[ATTR1:[0-9]+]] {15; CHECK-NEXT: call void @streaming_compatible_f()16; CHECK-NEXT: call void @streaming_compatible_f()17; CHECK-NEXT: ret void18;19 call void @streaming_compatible_f()20 call void @streaming_compatible_f()21 ret void22}23 24; Inline call to @non_streaming_callee to remove a streaming mode change.25define void @streaming_caller_inline() #0 "aarch64_pstate_sm_enabled" {26; CHECK-LABEL: define void @streaming_caller_inline27; CHECK-SAME: () #[[ATTR2:[0-9]+]] {28; CHECK-NEXT: call void @streaming_compatible_f()29; CHECK-NEXT: call void @streaming_compatible_f()30; CHECK-NEXT: ret void31;32 call void @non_streaming_callee()33 ret void34}35 36; Don't inline call to @non_streaming_callee when the inline-threshold is set to 1, because it does not eliminate a streaming-mode change.37define void @non_streaming_caller_dont_inline() #0 {38; CHECK-LABEL: define void @non_streaming_caller_dont_inline39; CHECK-SAME: () #[[ATTR1]] {40; CHECK-NEXT: call void @non_streaming_callee()41; CHECK-NEXT: ret void42;43 call void @non_streaming_callee()44 ret void45}46 47attributes #0 = { "target-features"="+sve,+sme" }48