Lines Matching refs:Func

274   static void markUsedByKernel(Function *Func, GlobalVariable *SGV) {  in markUsedByKernel()  argument
295 BasicBlock *Entry = &Func->getEntryBlock(); in markUsedByKernel()
299 Intrinsic::getDeclaration(Func->getParent(), Intrinsic::donothing, {}); in markUsedByKernel()
417 for (Function &Func : M.functions()) { in getTransitiveUsesOfLDS()
418 if (Func.isDeclaration() || isKernelLDS(&Func)) in getTransitiveUsesOfLDS()
422 SmallVector<Function *, 4> wip{&Func}; in getTransitiveUsesOfLDS()
429 set_union(transitive_map_function[&Func], direct_map_function[F]); in getTransitiveUsesOfLDS()
447 for (Function &Func : M.functions()) { in getTransitiveUsesOfLDS()
448 if (Func.isDeclaration() || !isKernelLDS(&Func)) in getTransitiveUsesOfLDS()
451 for (const CallGraphNode::CallRecord &R : *CG[&Func]) { in getTransitiveUsesOfLDS()
454 set_union(indirect_map_kernel[&Func], transitive_map_function[ith]); in getTransitiveUsesOfLDS()
456 set_union(indirect_map_kernel[&Func], in getTransitiveUsesOfLDS()
606 for (Function &Func : M.functions()) { in kernelsThatIndirectlyAccessAnyOfPassedVariables()
607 if (Func.isDeclaration() || !isKernelLDS(&Func)) in kernelsThatIndirectlyAccessAnyOfPassedVariables()
609 for (GlobalVariable *GV : LDSUsesInfo.indirect_access[&Func]) { in kernelsThatIndirectlyAccessAnyOfPassedVariables()
611 KernelSet.insert(&Func); in kernelsThatIndirectlyAccessAnyOfPassedVariables()
721 for (Function &Func : M->functions()) { in assignLDSKernelIDToEachKernel()
722 if (Func.isDeclaration()) in assignLDSKernelIDToEachKernel()
724 if (!isKernelLDS(&Func)) in assignLDSKernelIDToEachKernel()
727 if (KernelsThatAllocateTableLDS.contains(&Func) || in assignLDSKernelIDToEachKernel()
728 KernelsThatIndirectlyAllocateDynamicLDS.contains(&Func)) { in assignLDSKernelIDToEachKernel()
729 assert(Func.hasName()); // else fatal error earlier in assignLDSKernelIDToEachKernel()
730 OrderedKernels.push_back(&Func); in assignLDSKernelIDToEachKernel()
878 for (Function &Func : M.functions()) { in lowerModuleScopeStructVariables()
879 if (Func.isDeclaration() || !isKernelLDS(&Func)) in lowerModuleScopeStructVariables()
882 if (KernelsThatAllocateModuleLDS.contains(&Func)) { in lowerModuleScopeStructVariables()
890 return F == &Func; in lowerModuleScopeStructVariables()
893 markUsedByKernel(&Func, ModuleScopeReplacement.SGV); in lowerModuleScopeStructVariables()
910 for (Function &Func : M.functions()) { in lowerKernelScopeStructVariables()
911 if (Func.isDeclaration() || !isKernelLDS(&Func)) in lowerKernelScopeStructVariables()
917 for (auto &v : LDSUsesInfo.direct_access[&Func]) { in lowerKernelScopeStructVariables()
925 for (auto &v : LDSUsesInfo.indirect_access[&Func]) { in lowerKernelScopeStructVariables()
933 if (KernelsThatAllocateModuleLDS.contains(&Func)) { in lowerKernelScopeStructVariables()
951 if (!Func.hasName()) { in lowerKernelScopeStructVariables()
956 (Twine("llvm.amdgcn.kernel.") + Func.getName() + ".lds").str(); in lowerKernelScopeStructVariables()
964 auto Accesses = LDSUsesInfo.indirect_access.find(&Func); in lowerKernelScopeStructVariables()
967 markUsedByKernel(&Func, Replacement.SGV); in lowerKernelScopeStructVariables()
971 KernelToReplacement[&Func] = Replacement; in lowerKernelScopeStructVariables()
975 M, KernelUsedVariables, Replacement, [&Func](Use &U) { in lowerKernelScopeStructVariables()
977 return I && I->getFunction() == &Func; in lowerKernelScopeStructVariables()
1242 for (Function &Func : M.functions()) { in runOnModule()
1243 if (Func.isDeclaration() || !isKernelLDS(&Func)) in runOnModule()
1259 KernelsThatAllocateModuleLDS.contains(&Func); in runOnModule()
1261 auto Replacement = KernelToReplacement.find(&Func); in runOnModule()
1266 KernelToCreatedDynamicLDS.contains(&Func); in runOnModule()
1288 GlobalVariable *DynamicVariable = KernelToCreatedDynamicLDS[&Func]; in runOnModule()
1308 Func.addFnAttr("amdgpu-lds-size", Buffer); in runOnModule()