/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
H A D | ConstantMerge.cpp | 52 UsedValues.insert(GV); in FindUsedValues() 70 GV->getAllMetadata(MDs); in hasMetadataOtherThanDebugLoc() 87 GV->getParent()->getDataLayout().getPreferredAlign(GV)); in getAlign() 94 return !GV->isConstant() || !GV->hasDefinitiveInitializer() || in isUnmergeableGlobal() 95 GV->getType()->getAddressSpace() != 0 || GV->hasSection() || in isUnmergeableGlobal() 97 GV->isThreadLocal() || in isUnmergeableGlobal() 99 UsedGlobals.count(GV); in isUnmergeableGlobal() 157 if (GV.use_empty() && GV.hasLocalLinkage()) { in mergeConstants() 158 GV.eraseFromParent(); in mergeConstants() 187 Slot = &GV; in mergeConstants() [all …]
|
H A D | GlobalOpt.cpp | 348 AppendUses(GV); in collectSRATypes() 565 GV->getThreadLocalMode(), GV->getAddressSpace()); in SRAGlobal() 590 AppendUsers(GV); in SRAGlobal() 1309 if (!GV.isDiscardableIfUnused() && !GV.isDeclaration()) in deleteIfDead() 1561 GV->getLinkage(), SOVConstant, "", GV, GV->getThreadLocalMode(), in processInternalGlobal() 1567 GV = NGV; in processInternalGlobal() 2034 if (!GV.hasName() && !GV.isDeclaration() && !GV.hasLocalLinkage()) in OptimizeGlobalVars() 2172 bool usedErase(GlobalValue *GV) { return Used.erase(GV); } in usedErase() argument 2210 return U.usedCount(&GV) || U.compilerUsedCount(&GV); in mayHaveOtherReferences() 2256 (GV.isDSOLocal() || GV.isImplicitDSOLocal()); in OptimizeGlobalAliases() [all …]
|
H A D | Internalize.cpp | 105 if (GV.isDeclaration()) in shouldPreserveGV() 123 if (GV.hasLocalLinkage()) in shouldPreserveGV() 130 return MustPreserveGV(GV); in shouldPreserveGV() 136 if (Comdat *C = GV.getComdat()) { in maybeInternalize() 156 if (GV.hasLocalLinkage()) in maybeInternalize() 159 if (GV.hasLocalLinkage()) in maybeInternalize() 162 if (shouldPreserveGV(GV)) in maybeInternalize() 175 Comdat *C = GV.getComdat(); in checkComdat() 181 if (shouldPreserveGV(GV)) in checkComdat() 197 checkComdat(GV, ComdatMap); in internalizeModule() [all …]
|
H A D | ExtractGV.cpp | 25 bool Local = GV.hasLocalLinkage(); in makeVisible() 33 if (!GV.hasLinkOnceLinkage()) { in makeVisible() 34 assert(!GV.isDiscardableIfUnused()); in makeVisible() 39 switch (GV.getLinkage()) { in makeVisible() 43 GV.setLinkage(GlobalValue::WeakAnyLinkage); in makeVisible() 72 for (GlobalVariable &GV : M.globals()) { in run() 74 !GV.isDeclaration() && (!GV.isConstant() || !keepConstInit); in run() 76 if (GV.hasAvailableExternallyLinkage()) in run() 82 makeVisible(GV, Delete); in run() 86 GV.setInitializer(nullptr); in run() [all …]
|
H A D | GlobalSplit.cpp | 39 static bool splitGlobal(GlobalVariable &GV) { in splitGlobal() argument 42 if (!GV.hasLocalLinkage()) in splitGlobal() 54 for (User *U : GV.users()) { in splitGlobal() 67 GV.getMetadata(LLVMContext::MD_type, Types); in splitGlobal() 69 const DataLayout &DL = GV.getParent()->getDataLayout(); in splitGlobal() 107 *MDNode::get(GV.getContext(), in splitGlobal() 117 for (User *U : GV.users()) { in splitGlobal() 136 if (!GV.use_empty()) in splitGlobal() 137 GV.replaceAllUsesWith(PoisonValue::get(GV.getType())); in splitGlobal() 138 GV.eraseFromParent(); in splitGlobal() [all …]
|
H A D | GlobalDCE.cpp | 67 Deps.insert(GV); in ComputeDependencies() 85 for (User *User : GV.users()) in UpdateGVDependencies() 98 GVDependencies[GVU].insert(&GV); in UpdateGVDependencies() 110 Updates->push_back(&GV); in MarkLive() 111 if (Comdat *C = GV.getComdat()) { in MarkLive() 152 VFESafeVTables.insert(&GV); in ScanVTables() 269 if (Comdat *C = GV.getComdat()) in run() 331 if (GV.hasInitializer()) { in run() 367 GV->removeDeadConstantUsers(); in run() 368 GV->eraseFromParent(); in run() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/ |
H A D | ExecutionEngine.cpp | 165 if (GV && !GV->isDeclaration()) in FindGlobalVariableNamed() 376 if (!GV || GV->isDeclaration() || GV->hasLocalLinkage()) return; in runStaticConstructorsDestructors() 665 GV.IntVal = GV.IntVal.trunc(BitWidth); in getConstantValue() 671 GV.IntVal = GV.IntVal.zext(BitWidth); in getConstantValue() 677 GV.IntVal = GV.IntVal.sext(BitWidth); in getConstantValue() 683 GV.FloatVal = float(GV.DoubleVal); in getConstantValue() 689 GV.DoubleVal = double(GV.FloatVal); in getConstantValue() 697 GV.DoubleVal = GV.IntVal.roundToDouble(); in getConstantValue() 747 GV.IntVal = GV.IntVal.zextOrTrunc(IntWidth); in getConstantValue() 753 GV.IntVal = GV.IntVal.zextOrTrunc(PtrWidth); in getConstantValue() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | SplitModule.cpp | 113 if (GV.isDeclaration()) in findPartitions() 116 if (!GV.hasName()) in findPartitions() 128 Member = &GV; in findPartitions() 134 if (&GV != Root) in findPartitions() 146 if (GV.hasLocalLinkage()) in findPartitions() 147 addAllGlobalValueUsers(GVtoClusterMap, &GV, &GV); in findPartitions() 219 if (GV->hasLocalLinkage()) { in externalize() 226 if (!GV->hasName()) in externalize() 233 GV = Root; in isInPartition() 239 Name = GV->getName(); in isInPartition() [all …]
|
H A D | FunctionImportUtils.cpp | 92 const GlobalValue &GV) const { in isNonRenamableLocal() 93 if (!GV.hasLocalLinkage()) in isNonRenamableLocal() 96 if (GV.hasSection()) in isNonRenamableLocal() 223 if (GV.hasName()) { in processGlobalForThinLTO() 285 if (GV.hasLocalLinkage() && shouldPromoteLocalToGlobal(&GV, VI)) { in processGlobalForThinLTO() 288 GV.setName(getPromotedName(&GV)); in processGlobalForThinLTO() 289 GV.setLinkage(getLinkage(&GV, /* DoPromote */ true)); in processGlobalForThinLTO() 299 GV.setLinkage(getLinkage(&GV, /* DoPromote */ false)); in processGlobalForThinLTO() 308 GV.setDSOLocal(false); in processGlobalForThinLTO() 312 GV.setDSOLocal(true); in processGlobalForThinLTO() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/ |
H A D | TargetMachine.cpp | 55 if (!GV) in isLargeGlobalValue() 58 if (GV->isThreadLocal()) in isLargeGlobalValue() 63 if (auto CM = GV->getCodeModel()) { in isLargeGlobalValue() 74 if (GV->hasSection()) { in isLargeGlobalValue() 75 StringRef Name = GV->getSection(); in isLargeGlobalValue() 141 switch (GV->getThreadLocalMode()) { in getSelectedTLSModel() 170 if (!GV) in shouldAssumeDSOLocal() 174 if (GV->isDSOLocal()) in shouldAssumeDSOLocal() 188 isa<GlobalVariable>(GV)) in shouldAssumeDSOLocal() 194 if (GV->hasExternalWeakLinkage()) in shouldAssumeDSOLocal() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/IR/ |
H A D | Mangler.cpp | 123 if (GV->hasPrivateLinkage()) { in getNameWithPrefix() 131 if (!GV->hasName()) { in getNameWithPrefix() 134 unsigned &ID = AnonGlobalIDs[GV]; in getNameWithPrefix() 143 StringRef Name = GV->getName(); in getNameWithPrefix() 214 if (GV->hasDLLExportStorageClass() && !GV->isDeclaration()) { in emitLinkerFlagsForGlobalCOFF() 221 bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); in emitLinkerFlagsForGlobalCOFF() 239 if (!GV->getValueType()->isFunctionTy()) { in emitLinkerFlagsForGlobalCOFF() 246 if (GV->hasHiddenVisibility() && !GV->isDeclaration() && TT.isOSCygMing()) { in emitLinkerFlagsForGlobalCOFF() 250 bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); in emitLinkerFlagsForGlobalCOFF() 274 bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); in emitLinkerFlagsForUsedCOFF() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/XCore/ |
H A D | XCoreLowerThreadLocal.cpp | 49 bool lowerGlobal(GlobalVariable *GV); 112 for (User *U : GV->users()) in rewriteNonInstructionUses() 130 Module *M = GV->getParent(); in lowerGlobal() 131 if (!GV->isThreadLocal()) in lowerGlobal() 136 !GV->getType()->isSized() || isZeroLengthArray(GV->getType())) in lowerGlobal() 142 if (GV->hasInitializer()) in lowerGlobal() 146 new GlobalVariable(*M, NewType, GV->isConstant(), GV->getLinkage(), in lowerGlobal() 163 U->replaceUsesOfWith(GV, Addr); in lowerGlobal() 167 NewGV->takeName(GV); in lowerGlobal() 168 GV->eraseFromParent(); in lowerGlobal() [all …]
|
H A D | XCoreAsmPrinter.cpp | 89 assert( ( GV->hasExternalLinkage() || GV->hasWeakLinkage() || in emitArrayBound() 90 GV->hasLinkOnceLinkage() || GV->hasCommonLinkage() ) && in emitArrayBound() 100 if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || in emitArrayBound() 101 GV->hasCommonLinkage()) { in emitArrayBound() 109 if (!GV->hasInitializer() || emitSpecialLLVMGlobal(GV)) in emitGlobalVariable() 115 MCSymbol *GVSym = getSymbol(GV); in emitGlobalVariable() 122 switch (GV->getLinkage()) { in emitGlobalVariable() 131 emitArrayBound(GVSym, GV); in emitGlobalVariable() 134 if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || in emitGlobalVariable() 135 GV->hasCommonLinkage()) in emitGlobalVariable() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/X86/ |
H A D | X86Subtarget.cpp | 67 return classifyGlobalReference(GV, *GV->getParent()); in classifyGlobalReference() 76 if (AllowTaggedGlobals && CM != CodeModel::Large && GV && !isa<Function>(GV)) in classifyLocalReference() 93 if (GV) in classifyLocalReference() 115 if (GV && (GV->isDeclarationForLinker() || GV->hasCommonLinkage())) in classifyLocalReference() 131 if (GV) { in classifyGlobalReference() 143 if (TM.shouldAssumeDSOLocal(M, GV)) in classifyGlobalReference() 148 if (!GV) in classifyGlobalReference() 167 if (AllowTaggedGlobals && GV && !isa<Function>(GV)) in classifyGlobalReference() 187 return classifyGlobalFunctionReference(GV, *GV->getParent()); in classifyGlobalFunctionReference() 193 if (TM.shouldAssumeDSOLocal(M, GV)) in classifyGlobalFunctionReference() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Linker/ |
H A D | LinkModules.cpp | 345 if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { in linkIfNeeded() 369 GV.setVisibility(Visibility); in linkIfNeeded() 378 (GV.hasLocalLinkage() || GV.hasLinkOnceLinkage() || in linkIfNeeded() 382 if (GV.isDeclaration()) in linkIfNeeded() 398 ValuesToLink.insert(&GV); in linkIfNeeded() 404 if (!GV.hasLinkOnceLinkage() && !GV.hasAvailableExternallyLinkage() && in addLazyFor() 410 Add(GV); in addLazyFor() 430 Comdat *C = GV.getComdat(); in dropReplacedComdat() 435 if (GV.use_empty()) { in dropReplacedComdat() 436 GV.eraseFromParent(); in dropReplacedComdat() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/DirectX/ |
H A D | DirectXAsmPrinter.cpp | 37 void emitGlobalVariable(const GlobalVariable *GV) override; 42 void DXILAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { in emitGlobalVariable() argument 44 if (!GV->hasInitializer() || GV->hasImplicitSection() || !GV->hasSection()) in emitGlobalVariable() 47 if (GV->getSection() == "llvm.metadata") in emitGlobalVariable() 49 SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM); in emitGlobalVariable() 50 MCSection *TheSection = getObjFileLowering().SectionForGlobal(GV, GVKind, TM); in emitGlobalVariable() 52 emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer()); in emitGlobalVariable()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/ |
H A D | AMDGPULowerModuleLDSPass.cpp | 570 Builder.CreateIntToPtr(loaded, GV->getType(), GV->getName()); in replaceUseWithTableLookup() 633 : GV(GV), UserCount(UserCount), Size(AllocSize) {} in chooseBestVariableForModuleStrategy() 654 return GV->getName() < Other.GV->getName(); in chooseBestVariableForModuleStrategy() 668 GV, K.second.size(), in chooseBestVariableForModuleStrategy() 674 return MostUsed.GV; in chooseBestVariableForModuleStrategy() 1010 UpdateMaxAlignment(GV); in buildRepresentativeDynamicLDSInstance() 1014 UpdateMaxAlignment(GV); in buildRepresentativeDynamicLDSInstance() 1197 Vec.insert(GV); in runOnModule() 1317 if (GV.use_empty()) in runOnModule() 1458 GV->eraseFromParent(); in createLDSVariableReplacement() [all …]
|
H A D | AMDGPUMachineFunction.cpp | 97 auto Entry = LocalMemoryObjects.insert(std::pair(&GV, 0)); in allocateLDSGlobal() 102 DL.getValueOrABITypeAlignment(GV.getAlign(), GV.getValueType()); in allocateLDSGlobal() 105 if (GV.getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) { in allocateLDSGlobal() 107 std::optional<uint32_t> MaybeAbs = getLDSAbsoluteAddress(GV); in allocateLDSGlobal() 131 ObjectStart + DL.getTypeAllocSize(GV.getValueType()); in allocateLDSGlobal() 147 StaticLDSSize += DL.getTypeAllocSize(GV.getValueType()); in allocateLDSGlobal() 152 assert(GV.getAddressSpace() == AMDGPUAS::REGION_ADDRESS && in allocateLDSGlobal() 156 StaticGDSSize += DL.getTypeAllocSize(GV.getValueType()); in allocateLDSGlobal() 184 if (GV.getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS) in getLDSAbsoluteAddress() 205 assert(DL.getTypeAllocSize(GV.getValueType()).isZero()); in setDynLDSAlign() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/Utils/ |
H A D | AMDGPUMemoryUtils.cpp | 29 Align getAlign(DataLayout const &DL, const GlobalVariable *GV) { in getAlign() argument 30 return DL.getValueOrABITypeAlignment(GV->getPointerAlignment(DL), in getAlign() 31 GV->getValueType()); in getAlign() 34 bool isDynamicLDS(const GlobalVariable &GV) { in isDynamicLDS() argument 38 const Module *M = GV.getParent(); in isDynamicLDS() 43 uint64_t AllocSize = DL.getTypeAllocSize(GV.getValueType()); in isDynamicLDS() 44 return GV.hasExternalLinkage() && AllocSize == 0; in isDynamicLDS() 47 bool isLDSVariableToLower(const GlobalVariable &GV) { in isLDSVariableToLower() argument 51 if (isDynamicLDS(GV)) { in isLDSVariableToLower() 54 if (GV.isConstant()) { in isLDSVariableToLower() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/ |
H A D | NVPTXGenericToNVVM.cpp | 64 !llvm::isTexture(GV) && !llvm::isSurface(GV) && !llvm::isSampler(GV) && in runOnModule() 65 !GV.getName().starts_with("llvm.")) { in runOnModule() 67 M, GV.getValueType(), GV.isConstant(), GV.getLinkage(), in runOnModule() 68 GV.hasInitializer() ? GV.getInitializer() : nullptr, "", &GV, in runOnModule() 70 NewGV->copyAttributesFrom(&GV); in runOnModule() 72 GVMap[&GV] = NewGV; in runOnModule() 114 GlobalVariable *GV = I->first; in runOnModule() local 127 GV->replaceAllUsesWith(BitCastNewGV); in runOnModule() 129 GV->eraseFromParent(); in runOnModule() 155 GlobalVariable *GV = I->second; in remapConstant() local [all …]
|
H A D | NVPTXCtorDtorLowering.cpp | 51 static void addKernelMetadata(Module &M, GlobalValue *GV) { in addKernelMetadata() argument 77 llvm::ConstantAsMetadata::get(GV), in addKernelMetadata() 139 auto *GV = new GlobalVariable( in createInitOrFiniCalls() local 147 return GV; in createInitOrFiniCalls() 152 auto *GV = new GlobalVariable( in createInitOrFiniCalls() local 160 return GV; in createInitOrFiniCalls() 236 GV->setSection(IsCtor ? ".init_array" + PriorityStr in createInitOrFiniGlobals() 239 appendToUsed(M, {GV}); in createInitOrFiniGlobals() 248 if (!GV || !GV->hasInitializer()) in createInitOrFiniKernel() 251 if (!createInitOrFiniGlobals(M, GV, IsCtor)) in createInitOrFiniKernel() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Object/ |
H A D | ModuleSymbolTable.cpp | 61 SymTab.push_back(&GV); in addModule() 195 auto *GV = cast<GlobalValue *>(S); in printSymbolName() local 206 auto *GV = cast<GlobalValue *>(S); in getSymbolFlags() local 209 if (GV->isDeclarationForLinker()) in getSymbolFlags() 211 else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage()) in getSymbolFlags() 220 if (isa<GlobalAlias>(GV)) in getSymbolFlags() 222 if (GV->hasPrivateLinkage()) in getSymbolFlags() 224 if (!GV->hasLocalLinkage()) in getSymbolFlags() 226 if (GV->hasCommonLinkage()) in getSymbolFlags() 228 if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() || in getSymbolFlags() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/LTO/ |
H A D | UpdateCompilerUsed.cpp | 37 for (GlobalVariable &GV : TheModule.globals()) in findInModule() 38 findLibCallsAndAsm(GV); in findInModule() 88 void findLibCallsAndAsm(GlobalValue &GV) { in findLibCallsAndAsm() argument 90 if (GV.isDeclaration()) in findLibCallsAndAsm() 94 if (GV.hasPrivateLinkage()) in findLibCallsAndAsm() 104 if (isa<GlobalAlias>(GV)) { in findLibCallsAndAsm() 105 auto *A = cast<GlobalAlias>(&GV); in findLibCallsAndAsm() 108 if ((isa<Function>(GV) || FuncAliasee) && Libcalls.count(GV.getName())) { in findLibCallsAndAsm() 109 LLVMUsed.push_back(&GV); in findLibCallsAndAsm() 114 TM.getNameWithPrefix(Buffer, &GV, Mangler); in findLibCallsAndAsm() [all …]
|
H A D | LTOCodeGenerator.cpp | 451 if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || in preserveDiscardableGVs() 461 Used.push_back(&GV); in preserveDiscardableGVs() 464 mayPreserveGlobal(GV); in preserveDiscardableGVs() 486 if (!GV.hasName()) in applyScopeRestrictions() 509 if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() && in applyScopeRestrictions() 510 GV.hasName()) in applyScopeRestrictions() 511 ExternalSymbols.insert(std::make_pair(GV.getName(), GV.getLinkage())); in applyScopeRestrictions() 514 RecordLinkage(GV); in applyScopeRestrictions() 516 RecordLinkage(GV); in applyScopeRestrictions() 518 RecordLinkage(GV); in applyScopeRestrictions() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Analysis/ |
H A D | GlobalsModRef.cpp | 160 auto I = P->Map.find(&GV); in getModRefInfoForGlobal() 186 auto &GlobalMRI = P->Map[&GV]; in addModRefInfoForGlobal() 194 P->Map.erase(&GV); in eraseModRefInfoForGlobal() 220 if (I->second == GV) in deleted() 278 if (GV.hasLocalLinkage()) { in AnalyzeGlobals() 417 for (User *U : GV->users()) { in AnalyzeIndirectGlobalMemory() 462 IndirectGlobals.insert(GV); in AnalyzeIndirectGlobalMemory() 726 if (InputGV == GV) in isNonEscapingGlobalNoAlias() 866 GV1 = GV; in alias() 870 GV2 = GV; in alias() [all …]
|