brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ac28d9c Raw
40 lines · plain
1; RUN: llc -O0 -mtriple=amdgcn-unknown-amdhsa -mcpu=kaveri -disable-promote-alloca-to-vector=1 -mattr=+promote-alloca < %s | FileCheck -check-prefix=NOOPTS -check-prefix=ALL %s2; RUN: llc -O1 -mtriple=amdgcn-unknown-amdhsa -mcpu=kaveri -disable-promote-alloca-to-vector=1 -mattr=+promote-alloca < %s | FileCheck -check-prefix=OPTS -check-prefix=ALL %s3 4; ALL-LABEL: {{^}}promote_alloca_i32_array_array:5; NOOPTS: .amdhsa_group_segment_fixed_size 06; NOOPTS-NOT: ds_write7; OPTS: ds_write8define amdgpu_kernel void @promote_alloca_i32_array_array(ptr addrspace(1) %out, i32 %index) #0 {9entry:10  %alloca = alloca [2 x [2 x i32]], addrspace(5)11  %gep1 = getelementptr inbounds [2 x [2 x i32]], ptr addrspace(5) %alloca, i32 0, i32 0, i32 112  store i32 0, ptr addrspace(5) %alloca13  store i32 1, ptr addrspace(5) %gep114  %gep2 = getelementptr inbounds [2 x [2 x i32]], ptr addrspace(5) %alloca, i32 0, i32 0, i32 %index15  %load = load i32, ptr addrspace(5) %gep216  store i32 %load, ptr addrspace(1) %out17  ret void18}19 20; ALL-LABEL: {{^}}optnone_promote_alloca_i32_array_array:21; ALL: .amdhsa_group_segment_fixed_size 022; ALL-NOT: ds_write23define amdgpu_kernel void @optnone_promote_alloca_i32_array_array(ptr addrspace(1) %out, i32 %index) #1 {24entry:25  %alloca = alloca [2 x [2 x i32]], addrspace(5)26  %gep1 = getelementptr inbounds [2 x [2 x i32]], ptr addrspace(5) %alloca, i32 0, i32 0, i32 127  store i32 0, ptr addrspace(5) %alloca28  store i32 1, ptr addrspace(5) %gep129  %gep2 = getelementptr inbounds [2 x [2 x i32]], ptr addrspace(5) %alloca, i32 0, i32 0, i32 %index30  %load = load i32, ptr addrspace(5) %gep231  store i32 %load, ptr addrspace(1) %out32  ret void33}34 35attributes #0 = { nounwind "amdgpu-flat-work-group-size"="64,64" }36attributes #1 = { nounwind optnone noinline "amdgpu-flat-work-group-size"="64,64" }37 38!llvm.module.flags = !{!0}39!0 = !{i32 1, !"amdhsa_code_object_version", i32 400}40