Lines Matching refs:Func
264 static void markUsedByKernel(Function *Func, GlobalVariable *SGV) { in markUsedByKernel() argument
285 BasicBlock *Entry = &Func->getEntryBlock(); in markUsedByKernel()
289 Intrinsic::getDeclaration(Func->getParent(), Intrinsic::donothing, {}); in markUsedByKernel()
441 for (Function &Func : M.functions()) { in kernelsThatIndirectlyAccessAnyOfPassedVariables()
442 if (Func.isDeclaration() || !isKernelLDS(&Func)) in kernelsThatIndirectlyAccessAnyOfPassedVariables()
444 for (GlobalVariable *GV : LDSUsesInfo.indirect_access[&Func]) { in kernelsThatIndirectlyAccessAnyOfPassedVariables()
446 KernelSet.insert(&Func); in kernelsThatIndirectlyAccessAnyOfPassedVariables()
556 for (Function &Func : M->functions()) { in assignLDSKernelIDToEachKernel()
557 if (Func.isDeclaration()) in assignLDSKernelIDToEachKernel()
559 if (!isKernelLDS(&Func)) in assignLDSKernelIDToEachKernel()
562 if (KernelsThatAllocateTableLDS.contains(&Func) || in assignLDSKernelIDToEachKernel()
563 KernelsThatIndirectlyAllocateDynamicLDS.contains(&Func)) { in assignLDSKernelIDToEachKernel()
564 assert(Func.hasName()); // else fatal error earlier in assignLDSKernelIDToEachKernel()
565 OrderedKernels.push_back(&Func); in assignLDSKernelIDToEachKernel()
713 for (Function &Func : M.functions()) { in lowerModuleScopeStructVariables()
714 if (Func.isDeclaration() || !isKernelLDS(&Func)) in lowerModuleScopeStructVariables()
717 if (KernelsThatAllocateModuleLDS.contains(&Func)) { in lowerModuleScopeStructVariables()
725 return F == &Func; in lowerModuleScopeStructVariables()
728 markUsedByKernel(&Func, ModuleScopeReplacement.SGV); in lowerModuleScopeStructVariables()
745 for (Function &Func : M.functions()) { in lowerKernelScopeStructVariables()
746 if (Func.isDeclaration() || !isKernelLDS(&Func)) in lowerKernelScopeStructVariables()
752 for (auto &v : LDSUsesInfo.direct_access[&Func]) { in lowerKernelScopeStructVariables()
760 for (auto &v : LDSUsesInfo.indirect_access[&Func]) { in lowerKernelScopeStructVariables()
768 if (KernelsThatAllocateModuleLDS.contains(&Func)) { in lowerKernelScopeStructVariables()
786 if (!Func.hasName()) { in lowerKernelScopeStructVariables()
791 (Twine("llvm.amdgcn.kernel.") + Func.getName() + ".lds").str(); in lowerKernelScopeStructVariables()
799 auto Accesses = LDSUsesInfo.indirect_access.find(&Func); in lowerKernelScopeStructVariables()
802 markUsedByKernel(&Func, Replacement.SGV); in lowerKernelScopeStructVariables()
806 KernelToReplacement[&Func] = Replacement; in lowerKernelScopeStructVariables()
810 M, KernelUsedVariables, Replacement, [&Func](Use &U) { in lowerKernelScopeStructVariables()
812 return I && I->getFunction() == &Func; in lowerKernelScopeStructVariables()
1032 for (Function &Func : M.functions()) { in runOnModule()
1033 if (Func.isDeclaration() || !isKernelLDS(&Func)) in runOnModule()
1049 KernelsThatAllocateModuleLDS.contains(&Func); in runOnModule()
1051 auto Replacement = KernelToReplacement.find(&Func); in runOnModule()
1056 KernelToCreatedDynamicLDS.contains(&Func); in runOnModule()
1078 GlobalVariable *DynamicVariable = KernelToCreatedDynamicLDS[&Func]; in runOnModule()
1098 Func.addFnAttr("amdgpu-lds-size", Buffer); in runOnModule()