Lines Matching refs:Func

186   void buildSwLDSGlobal(Function *Func);
187 void buildSwDynLDSGlobal(Function *Func);
188 void populateSwMetadataGlobal(Function *Func);
189 void populateSwLDSAttributeAndMetadata(Function *Func);
190 void populateLDSToReplacementIndicesMap(Function *Func);
191 void getLDSMemoryInstructions(Function *Func,
193 void replaceKernelLDSAccesses(Function *Func);
196 Function *Func, Value *LoadMallocPtr,
198 void poisonRedzones(Function *Func, Value *MallocPtr);
199 void lowerKernelLDSAccesses(Function *Func, DomTreeUpdater &DTU);
203 getAddressesOfVariablesInKernel(Function *Func,
205 void lowerNonKernelLDSAccesses(Function *Func,
209 updateMallocSizeForDynamicLDS(Function *Func, Value **CurrMallocSize,
253 Function *Func = OrderedKernels[i]; in getOrderedIndirectLDSAccessingKernels() local
254 Func->setMetadata("llvm.amdgcn.lds.kernel.id", in getOrderedIndirectLDSAccessingKernels()
265 Function *Func = K.first; in getNonKernelsWithLDSArguments() local
266 const CallGraphNode *CGN = CG[Func]; in getNonKernelsWithLDSArguments()
286 FuncLDSAccessInfo.KernelsWithIndirectLDSAccess.insert(Func); in getNonKernelsWithLDSArguments()
319 static void addLDSSizeAttribute(Function *Func, uint32_t Offset, in addLDSSizeAttribute() argument
327 Func->addFnAttr("amdgpu-lds-size", Buffer); in addLDSSizeAttribute()
331 static void markUsedByKernel(Function *Func, GlobalVariable *SGV) { in markUsedByKernel() argument
332 BasicBlock *Entry = &Func->getEntryBlock(); in markUsedByKernel()
335 Function *Decl = Intrinsic::getOrInsertDeclaration(Func->getParent(), in markUsedByKernel()
345 void AMDGPUSwLowerLDS::buildSwLDSGlobal(Function *Func) { in buildSwLDSGlobal() argument
348 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in buildSwLDSGlobal()
352 PoisonValue::get(IRB.getPtrTy()), "llvm.amdgcn.sw.lds." + Func->getName(), in buildSwLDSGlobal()
359 void AMDGPUSwLowerLDS::buildSwDynLDSGlobal(Function *Func) { in buildSwDynLDSGlobal() argument
361 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in buildSwDynLDSGlobal()
369 "llvm.amdgcn." + Func->getName() + ".dynlds", nullptr, in buildSwDynLDSGlobal()
371 markUsedByKernel(Func, LDSParams.SwDynLDS); in buildSwDynLDSGlobal()
377 void AMDGPUSwLowerLDS::populateSwLDSAttributeAndMetadata(Function *Func) { in populateSwLDSAttributeAndMetadata() argument
378 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in populateSwLDSAttributeAndMetadata()
382 addLDSSizeAttribute(Func, Offset, IsDynLDSUsed); in populateSwLDSAttributeAndMetadata()
387 void AMDGPUSwLowerLDS::populateSwMetadataGlobal(Function *Func) { in populateSwMetadataGlobal() argument
390 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in populateSwMetadataGlobal()
417 MDItemOS << "llvm.amdgcn.sw.lds." << Func->getName() << ".md.item"; in populateSwMetadataGlobal()
473 MDTypeOS << "llvm.amdgcn.sw.lds." << Func->getName() << ".md.type"; in populateSwMetadataGlobal()
478 MDOS << "llvm.amdgcn.sw.lds." << Func->getName() << ".md"; in populateSwMetadataGlobal()
495 void AMDGPUSwLowerLDS::populateLDSToReplacementIndicesMap(Function *Func) { in populateLDSToReplacementIndicesMap() argument
498 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in populateLDSToReplacementIndicesMap()
520 static void replacesUsesOfGlobalInFunction(Function *Func, GlobalVariable *GV, in replacesUsesOfGlobalInFunction() argument
523 auto ReplaceUsesLambda = [Func](const Use &U) -> bool { in replacesUsesOfGlobalInFunction()
527 if (Func == Func1) in replacesUsesOfGlobalInFunction()
535 void AMDGPUSwLowerLDS::replaceKernelLDSAccesses(Function *Func) { in replaceKernelLDSAccesses() argument
536 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in replaceKernelLDSAccesses()
572 replacesUsesOfGlobalInFunction(Func, GV, BasePlusOffset); in replaceKernelLDSAccesses()
582 Function *Func, Value **CurrMallocSize, Value *HiddenDynLDSSize, in updateMallocSizeForDynamicLDS() argument
584 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in updateMallocSizeForDynamicLDS()
640 Function *Func, SetVector<Instruction *> &LDSInstructions) { in getLDSMemoryInstructions() argument
641 for (BasicBlock &BB : *Func) { in getLDSMemoryInstructions()
682 Function *Func, Value *LoadMallocPtr, in translateLDSMemoryOperationsToGlobalMemory() argument
685 << Func->getName()); in translateLDSMemoryOperationsToGlobalMemory()
747 void AMDGPUSwLowerLDS::poisonRedzones(Function *Func, Value *MallocPtr) { in poisonRedzones() argument
748 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in poisonRedzones()
769 void AMDGPUSwLowerLDS::lowerKernelLDSAccesses(Function *Func, in lowerKernelLDSAccesses() argument
771 LLVM_DEBUG(dbgs() << "Sw Lowering Kernel LDS for : " << Func->getName()); in lowerKernelLDSAccesses()
772 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in lowerKernelLDSAccesses()
774 auto *PrevEntryBlock = &Func->getEntryBlock(); in lowerKernelLDSAccesses()
776 getLDSMemoryInstructions(Func, LDSInstructions); in lowerKernelLDSAccesses()
779 auto *MallocBlock = BasicBlock::Create(Ctx, "Malloc", Func, PrevEntryBlock); in lowerKernelLDSAccesses()
783 auto *WIdBlock = BasicBlock::Create(Ctx, "WId", Func, MallocBlock); in lowerKernelLDSAccesses()
786 getOrCreateDebugLoc(&*PrevEntryBlock->begin(), Func->getSubprogram()); in lowerKernelLDSAccesses()
862 updateMallocSizeForDynamicLDS(Func, &CurrMallocSize, HiddenDynLDSSize, in lowerKernelLDSAccesses()
885 poisonRedzones(Func, MallocPtr); in lowerKernelLDSAccesses()
904 replaceKernelLDSAccesses(Func); in lowerKernelLDSAccesses()
908 translateLDSMemoryOperationsToGlobalMemory(Func, LoadMallocPtr, in lowerKernelLDSAccesses()
911 auto *CondFreeBlock = BasicBlock::Create(Ctx, "CondFree", Func); in lowerKernelLDSAccesses()
912 auto *FreeBlock = BasicBlock::Create(Ctx, "Free", Func); in lowerKernelLDSAccesses()
913 auto *EndBlock = BasicBlock::Create(Ctx, "End", Func); in lowerKernelLDSAccesses()
914 for (BasicBlock &BB : *Func) { in lowerKernelLDSAccesses()
955 Function *Func, SetVector<GlobalVariable *> &Variables) { in getAddressesOfVariablesInKernel() argument
957 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in getAddressesOfVariablesInKernel()
999 Function *Func = Kernels[i]; in buildNonKernelLDSBaseTable() local
1000 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in buildNonKernelLDSBaseTable()
1042 Function *Func = Kernels[i]; in buildNonKernelLDSOffsetTable() local
1044 getAddressesOfVariablesInKernel(Func, Variables); in buildNonKernelLDSOffsetTable()
1058 Function *Func, SetVector<GlobalVariable *> &LDSGlobals, in lowerNonKernelLDSAccesses() argument
1063 << Func->getName()); in lowerNonKernelLDSAccesses()
1064 auto InsertAt = Func->getEntryBlock().getFirstNonPHIOrDbgOrAlloca(); in lowerNonKernelLDSAccesses()
1069 getLDSMemoryInstructions(Func, LDSInstructions); in lowerNonKernelLDSAccesses()
1097 replacesUsesOfGlobalInFunction(Func, GV, BasePlusOffset); in lowerNonKernelLDSAccesses()
1099 translateLDSMemoryOperationsToGlobalMemory(Func, LoadMallocPtr, in lowerNonKernelLDSAccesses()
1205 Function *Func = K.first; in run() local
1206 auto &LDSParams = FuncLDSAccessInfo.KernelToLDSParametersMap[Func]; in run()
1214 CG, Func, in run()
1219 removeFnAttrFromReachable(CG, Func, {"amdgpu-no-lds-kernel-id"}); in run()
1221 buildSwLDSGlobal(Func); in run()
1222 buildSwDynLDSGlobal(Func); in run()
1223 populateSwMetadataGlobal(Func); in run()
1224 populateSwLDSAttributeAndMetadata(Func); in run()
1225 populateLDSToReplacementIndicesMap(Func); in run()
1226 DomTreeUpdater DTU(DTCallback(*Func), in run()
1228 lowerKernelLDSAccesses(Func, DTU); in run()
1250 Function *Func = K.first; in run() local
1254 lowerNonKernelLDSAccesses(Func, OrderedLDSGlobals, NKLDSParams); in run()
1256 for (Function *Func : FuncLDSAccessInfo.NonKernelsWithLDSArgument) { in run()
1258 if (K.contains(Func)) in run()
1261 lowerNonKernelLDSAccesses(Func, Vec, NKLDSParams); in run()