xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/kernarg-stack-alignment.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -O0 -march=amdgcn -verify-machineinstrs < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Test that the alignment of kernel arguments does not impact the
4*9880d681SAndroid Build Coastguard Worker; alignment of the stack
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}no_args:
7*9880d681SAndroid Build Coastguard Worker; CHECK: ScratchSize: 8{{$}}
8*9880d681SAndroid Build Coastguard Workerdefine void @no_args() {
9*9880d681SAndroid Build Coastguard Worker  %alloca = alloca i8
10*9880d681SAndroid Build Coastguard Worker  store volatile i8 0, i8* %alloca
11*9880d681SAndroid Build Coastguard Worker  ret void
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}force_align32:
15*9880d681SAndroid Build Coastguard Worker; CHECK: ScratchSize: 8{{$}}
16*9880d681SAndroid Build Coastguard Workerdefine void @force_align32(<8 x i32>) {
17*9880d681SAndroid Build Coastguard Worker  %alloca = alloca i8
18*9880d681SAndroid Build Coastguard Worker  store volatile i8 0, i8* %alloca
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}force_align64:
23*9880d681SAndroid Build Coastguard Worker; CHECK: ScratchSize: 8{{$}}
24*9880d681SAndroid Build Coastguard Workerdefine void @force_align64(<16 x i32>) {
25*9880d681SAndroid Build Coastguard Worker  %alloca = alloca i8
26*9880d681SAndroid Build Coastguard Worker  store volatile i8 0, i8* %alloca
27*9880d681SAndroid Build Coastguard Worker  ret void
28*9880d681SAndroid Build Coastguard Worker}
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}force_align128:
31*9880d681SAndroid Build Coastguard Worker; CHECK: ScratchSize: 8{{$}}
32*9880d681SAndroid Build Coastguard Workerdefine void @force_align128(<32 x i32>) {
33*9880d681SAndroid Build Coastguard Worker  %alloca = alloca i8
34*9880d681SAndroid Build Coastguard Worker  store volatile i8 0, i8* %alloca
35*9880d681SAndroid Build Coastguard Worker  ret void
36*9880d681SAndroid Build Coastguard Worker}
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}force_align256:
39*9880d681SAndroid Build Coastguard Worker; CHECK: ScratchSize: 8{{$}}
40*9880d681SAndroid Build Coastguard Workerdefine void @force_align256(<64 x i32>) {
41*9880d681SAndroid Build Coastguard Worker  %alloca = alloca i8
42*9880d681SAndroid Build Coastguard Worker  store volatile i8 0, i8* %alloca
43*9880d681SAndroid Build Coastguard Worker  ret void
44*9880d681SAndroid Build Coastguard Worker}
45