[clang] [llvm] [AMDGPU] Add initial support for VGPR as memory (PR #205435)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 25 07:46:57 PDT 2026
================
@@ -455,6 +645,21 @@ bool AMDGPUPromoteAllocaImpl::run(Function &F, bool PromoteToLDS) {
return Changed;
}
+void AMDGPUPromoteAllocaImpl::allocateVgprs(AllocaAnalysis &AA) {
+ LLVMContext &Ctx = Mod->getContext();
+ const unsigned AllocaSize =
+ DL->getTypeSizeInBits(AA.Alloca->getAllocatedType()) / 8;
+
+ // Record where the object was allocated within the VGPR file.
+ Type *I32 = Type::getInt32Ty(Ctx);
+ AA.Alloca->setMetadata(
----------------
arsenm wrote:
Using function metadata for this is weird. I expect all ABI influencing properties to be manifest as IR attributes.
I also don't like trying to repurpose AMDGPUPromoteAlloca as a lowering pass. It isn't written as one, and the consequence is you have your failure condition which is a function of the exact optimization pipeline
https://github.com/llvm/llvm-project/pull/205435
More information about the llvm-commits
mailing list