[AMDGPU] Limit promote alloca max size in functions
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 23 Sep 2021 23:03:48 +0000 (16:03 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 24 Sep 2021 20:38:39 +0000 (13:38 -0700)
commitcf74ef134c9a8089d8997144d54628952c6d4552
tree0a1db49148dfc903492c1f60e2b420ffa554dfa7
parent70a48697d5f547ca72053b5dcf0d10756f6f2477
[AMDGPU] Limit promote alloca max size in functions

Non-entry functions have 32 caller saved VGPRs available. If we
promote alloca to consume more registers we will have to spill
CSRs. There is no reason to eliminate scratch access to get
another scratch access instead.

Differential Revision: https://reviews.llvm.org/D110372
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
llvm/test/CodeGen/AMDGPU/vector-alloca-limits.ll