1 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-promote-alloca < %s | FileCheck %s
3 ; Do not promote an alloca with users of vector/aggregate type.
5 ; CHECK-LABEL: @test_insertelement(
6 ; CHECK: %alloca = alloca i16
7 ; CHECK-NEXT: insertelement <2 x i16*> undef, i16* %alloca, i32 0
8 define amdgpu_kernel void @test_insertelement() #0 {
10 %alloca = alloca i16, align 4
11 %in = insertelement <2 x i16*> undef, i16* %alloca, i32 0
12 store <2 x i16*> %in, <2 x i16*>* undef, align 4
16 ; CHECK-LABEL: @test_insertvalue(
17 ; CHECK: %alloca = alloca i16
18 ; CHECK-NEXT: insertvalue { i16* } undef, i16* %alloca, 0
19 define amdgpu_kernel void @test_insertvalue() #0 {
21 %alloca = alloca i16, align 4
22 %in = insertvalue { i16* } undef, i16* %alloca, 0
23 store { i16* } %in, { i16* }* undef, align 4
27 ; CHECK-LABEL: @test_insertvalue_array(
28 ; CHECK: %alloca = alloca i16
29 ; CHECK-NEXT: insertvalue [2 x i16*] undef, i16* %alloca, 0
30 define amdgpu_kernel void @test_insertvalue_array() #0 {
32 %alloca = alloca i16, align 4
33 %in = insertvalue [2 x i16*] undef, i16* %alloca, 0
34 store [2 x i16*] %in, [2 x i16*]* undef, align 4
38 attributes #0 = { nounwind }