================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to