Lines Matching refs:GV

122 SmallPtrSet<Function *, 8> collectNonKernelAccessorsOfLDS(GlobalVariable *GV);
147 llvm::erase_if(LDSGlobals, [&](GlobalVariable *GV) { in collectLDSRequiringPointerReplace() argument
148 return shouldIgnorePointerReplacement(GV); in collectLDSRequiringPointerReplace()
156 bool shouldIgnorePointerReplacement(GlobalVariable *GV) { in shouldIgnorePointerReplacement() argument
159 if (DL.getTypeAllocSize(GV->getValueType()) <= 2) in shouldIgnorePointerReplacement()
164 LDSToNonKernels[GV] = AMDGPU::collectNonKernelAccessorsOfLDS(GV); in shouldIgnorePointerReplacement()
165 return LDSToNonKernels[GV].empty(); in shouldIgnorePointerReplacement()
172 GlobalVariable *createLDSPointer(GlobalVariable *GV) { in createLDSPointer() argument
174 auto PointerEntry = LDSToPointer.insert(std::make_pair(GV, nullptr)); in createLDSPointer()
185 GV->getName() + Twine(".ptr"), nullptr, GlobalVariable::NotThreadLocal, in createLDSPointer()
192 LDSToPointer[GV] = LDSPointer; in createLDSPointer()
226 void initializeLDSPointer(Function *K, GlobalVariable *GV, in initializeLDSPointer() argument
242 Builder.CreateStore(Builder.CreatePtrToInt(GV, Type::getInt16Ty(Ctx)), in initializeLDSPointer()
252 void replaceLDSUseByPointer(GlobalVariable *GV, GlobalVariable *LDSPointer) { in replaceLDSUseByPointer() argument
253 SmallVector<User *, 8> LDSUsers(GV->users()); in replaceLDSUseByPointer()
285 auto *ReplaceInst = getReplacementInst(F, GV, LDSPointer); in replaceLDSUseByPointer()
286 II->replaceUsesOfWith(GV, ReplaceInst); in replaceLDSUseByPointer()
295 Value *getReplacementInst(Function *F, GlobalVariable *GV, in getReplacementInst() argument
303 LDSEntry.first->second.insert(std::make_pair(GV, nullptr)); in getReplacementInst()
318 GV->getType()); in getReplacementInst()
322 FunctionToLDSToReplaceInst[F][GV] = V; in getReplacementInst()
343 bool replaceLDSUse(GlobalVariable *GV);
348 bool ReplaceLDSUseImpl::replaceLDSUse(GlobalVariable *GV) { in replaceLDSUse() argument
350 SmallPtrSet<Function *, 8> &LDSAccessors = LDSToNonKernels[GV]; in replaceLDSUse()
374 LDSPointer = createLDSPointer(GV); in replaceLDSUse()
377 initializeLDSPointer(K, GV, LDSPointer); in replaceLDSUse()
388 replaceLDSUseByPointer(GV, LDSPointer); in replaceLDSUse()
496 SmallPtrSet<Function *, 8> collectNonKernelAccessorsOfLDS(GlobalVariable *GV) { in collectNonKernelAccessorsOfLDS() argument
498 SmallVector<User *, 8> UserStack(GV->users()); in collectNonKernelAccessorsOfLDS()
596 for (auto *GV : LDSGlobals) in replaceLDSUse() local
597 Changed |= replaceLDSUse(GV); in replaceLDSUse()