| /llvm-project-15.0.7/llvm/tools/llvm-reduce/deltas/ |
| H A D | ReduceGlobalValues.cpp | 19 static bool shouldReduceDSOLocal(GlobalValue &GV) { in shouldReduceDSOLocal() argument 20 return GV.isDSOLocal() && !GV.isImplicitDSOLocal(); in shouldReduceDSOLocal() 23 static bool shouldReduceVisibility(GlobalValue &GV) { in shouldReduceVisibility() argument 32 return GV.getDLLStorageClass() != in shouldReduceDLLStorageClass() 37 return GV.isThreadLocal(); in shouldReduceThreadLocal() 41 for (auto &GV : Program.global_values()) { in reduceGVs() local 42 if (shouldReduceDSOLocal(GV) && !O.shouldKeep()) in reduceGVs() 43 GV.setDSOLocal(false); in reduceGVs() 48 GV.setDSOLocal(false); in reduceGVs() 53 GV.setDLLStorageClass( in reduceGVs() [all …]
|
| H A D | ReduceGlobalVars.cpp | 25 for (auto &GV : Program.globals()) in extractGVsFromModule() local 27 InitGVsToKeep.push_back(&GV); in extractGVsFromModule() 38 for (auto &GV : Program.globals()) in extractGVsFromModule() local 39 if (!GVsToKeep.count(&GV)) { in extractGVsFromModule() 40 for (auto *U : GV.users()) in extractGVsFromModule() 44 GV.replaceAllUsesWith(getDefaultValue(GV.getType())); in extractGVsFromModule() 45 ToRemove.push_back(&GV); in extractGVsFromModule() 57 for (auto *GV : ToRemove) in extractGVsFromModule() local 58 GV->eraseFromParent(); in extractGVsFromModule()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/IPO/ |
| H A D | ConstantMerge.cpp | 54 UsedValues.insert(GV); in FindUsedValues() 72 GV->getAllMetadata(MDs); in hasMetadataOtherThanDebugLoc() 89 GV->getParent()->getDataLayout().getPreferredAlign(GV)); in getAlign() 96 return !GV->isConstant() || !GV->hasDefinitiveInitializer() || in isUnmergeableGlobal() 97 GV->getType()->getAddressSpace() != 0 || GV->hasSection() || in isUnmergeableGlobal() 99 GV->isThreadLocal() || in isUnmergeableGlobal() 101 UsedGlobals.count(GV); in isUnmergeableGlobal() 159 if (GV.use_empty() && GV.hasLocalLinkage()) { in mergeConstants() 160 GV.eraseFromParent(); in mergeConstants() 189 Slot = &GV; in mergeConstants() [all …]
|
| H A D | GlobalOpt.cpp | 350 AppendUses(GV); in collectSRATypes() 520 GV->getThreadLocalMode(), GV->getAddressSpace()); in SRAGlobal() 545 AppendUsers(GV); in SRAGlobal() 1287 if (!GV.isDiscardableIfUnused() && !GV.isDeclaration()) in deleteIfDead() 1610 GV->getLinkage(), SOVConstant, "", GV, GV->getThreadLocalMode(), in processInternalGlobal() 1616 GV = NGV; in processInternalGlobal() 2071 if (!GV.hasName() && !GV.isDeclaration() && !GV.hasLocalLinkage()) in OptimizeGlobalVars() 2197 bool usedCount(GlobalValue *GV) const { return Used.count(GV); } in usedCount() 2203 bool usedErase(GlobalValue *GV) { return Used.erase(GV); } in usedErase() argument 2300 (GV.isDSOLocal() || GV.isImplicitDSOLocal()); in OptimizeGlobalAliases() [all …]
|
| H A D | ExtractGV.cpp | 25 bool Local = GV.hasLocalLinkage(); in makeVisible() 27 GV.setLinkage(GlobalValue::ExternalLinkage); 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() 46 GV.setLinkage(GlobalValue::WeakODRLinkage); in makeVisible() 86 !GV.isDeclaration() && in runOnModule() 95 makeVisible(GV, Delete); in runOnModule() 99 GV.setInitializer(nullptr); in runOnModule() [all …]
|
| H A D | Internalize.cpp | 106 if (GV.isDeclaration()) in shouldPreserveGV() 124 if (GV.hasLocalLinkage()) in shouldPreserveGV() 131 return MustPreserveGV(GV); in shouldPreserveGV() 137 if (Comdat *C = GV.getComdat()) { in maybeInternalize() 157 if (GV.hasLocalLinkage()) in maybeInternalize() 160 if (GV.hasLocalLinkage()) in maybeInternalize() 163 if (shouldPreserveGV(GV)) in maybeInternalize() 176 Comdat *C = GV.getComdat(); in checkComdat() 182 if (shouldPreserveGV(GV)) in checkComdat() 199 checkComdat(GV, ComdatMap); in internalizeModule() [all …]
|
| H A D | GlobalSplit.cpp | 41 static bool splitGlobal(GlobalVariable &GV) { in splitGlobal() argument 44 if (!GV.hasLocalLinkage()) in splitGlobal() 56 for (User *U : GV.users()) { in splitGlobal() 69 GV.getMetadata(LLVMContext::MD_type, Types); in splitGlobal() 71 const DataLayout &DL = GV.getParent()->getDataLayout(); in splitGlobal() 109 *MDNode::get(GV.getContext(), in splitGlobal() 119 for (User *U : GV.users()) { in splitGlobal() 138 if (!GV.use_empty()) in splitGlobal() 139 GV.replaceAllUsesWith(PoisonValue::get(GV.getType())); in splitGlobal() 140 GV.eraseFromParent(); in splitGlobal() [all …]
|
| H A D | GlobalDCE.cpp | 110 Deps.insert(GV); in ComputeDependencies() 128 for (User *User : GV.users()) in UpdateGVDependencies() 141 GVDependencies[GVU].insert(&GV); in UpdateGVDependencies() 153 Updates->push_back(&GV); in MarkLive() 154 if (Comdat *C = GV.getComdat()) { in MarkLive() 201 VFESafeVTables.insert(&GV); in ScanVTables() 311 if (Comdat *C = GV.getComdat()) in run() 373 if (GV.hasInitializer()) { in run() 409 GV->removeDeadConstantUsers(); in run() 410 GV->eraseFromParent(); in run() [all …]
|
| /llvm-project-15.0.7/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() 653 GV.IntVal = GV.IntVal.trunc(BitWidth); in getConstantValue() 659 GV.IntVal = GV.IntVal.zext(BitWidth); in getConstantValue() 665 GV.IntVal = GV.IntVal.sext(BitWidth); in getConstantValue() 671 GV.FloatVal = float(GV.DoubleVal); in getConstantValue() 677 GV.DoubleVal = double(GV.FloatVal); in getConstantValue() 685 GV.DoubleVal = GV.IntVal.roundToDouble(); in getConstantValue() 735 GV.IntVal = GV.IntVal.zextOrTrunc(IntWidth); in getConstantValue() 741 GV.IntVal = GV.IntVal.zextOrTrunc(PtrWidth); in getConstantValue() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Utils/ |
| H A D | FunctionImportUtils.cpp | 82 const GlobalValue &GV) const { in isNonRenamableLocal() 83 if (!GV.hasLocalLinkage()) in isNonRenamableLocal() 86 if (GV.hasSection()) in isNonRenamableLocal() 203 if (GV.hasName()) { in processGlobalForThinLTO() 265 if (GV.hasLocalLinkage() && shouldPromoteLocalToGlobal(&GV, VI)) { in processGlobalForThinLTO() 268 GV.setName(getPromotedName(&GV)); in processGlobalForThinLTO() 269 GV.setLinkage(getLinkage(&GV, /* DoPromote */ true)); in processGlobalForThinLTO() 279 GV.setLinkage(getLinkage(&GV, /* DoPromote */ false)); in processGlobalForThinLTO() 288 GV.setDSOLocal(false); in processGlobalForThinLTO() 292 GV.setDSOLocal(true); in processGlobalForThinLTO() [all …]
|
| 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 …]
|
| /llvm-project-15.0.7/llvm/unittests/Transforms/Utils/ |
| H A D | CallPromotionUtilsTest.cpp | 55 ASSERT_TRUE(GV); in TEST() 68 ASSERT_TRUE(GV); in TEST() 88 ASSERT_TRUE(GV); in TEST() 115 ASSERT_TRUE(GV); in TEST() 150 ASSERT_TRUE(GV); in TEST() 189 ASSERT_TRUE(GV); in TEST() 231 ASSERT_TRUE(GV); in TEST() 290 ASSERT_TRUE(GV); in TEST() 303 ASSERT_TRUE(GV); in TEST() 308 ASSERT_TRUE(GV); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Linker/ |
| H A D | LinkModules.cpp | 345 if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { in linkIfNeeded() 365 GV.setVisibility(Visibility); in linkIfNeeded() 374 (GV.hasLocalLinkage() || GV.hasLinkOnceLinkage() || in linkIfNeeded() 378 if (GV.isDeclaration()) in linkIfNeeded() 394 ValuesToLink.insert(&GV); in linkIfNeeded() 400 if (!GV.hasLinkOnceLinkage() && !GV.hasAvailableExternallyLinkage() && in addLazyFor() 406 Add(GV); in addLazyFor() 426 Comdat *C = GV.getComdat(); in dropReplacedComdat() 431 if (GV.use_empty()) { in dropReplacedComdat() 432 GV.eraseFromParent(); in dropReplacedComdat() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/ |
| H A D | TargetMachine.cpp | 72 switch (GV->getThreadLocalMode()) { in getSelectedTLSModel() 101 if (!GV) in shouldAssumeDSOLocal() 105 if (GV->isDSOLocal()) in shouldAssumeDSOLocal() 110 if (GV->hasDLLImportStorageClass()) in shouldAssumeDSOLocal() 119 isa<GlobalVariable>(GV)) in shouldAssumeDSOLocal() 125 if (GV->hasExternalWeakLinkage()) in shouldAssumeDSOLocal() 138 return GV->isStrongDefinitionForLinker(); in shouldAssumeDSOLocal() 158 bool IsLocal = shouldAssumeDSOLocal(*GV->getParent(), GV); in getTLSModel() 197 Mang.getNameWithPrefix(Name, GV, false); in getNameWithPrefix() 201 TLOF->getNameWithPrefix(Name, GV, *this); in getNameWithPrefix() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/X86/ |
| H A D | X86Subtarget.cpp | 67 return classifyGlobalReference(GV, *GV->getParent()); in classifyGlobalReference() 76 !isa<Function>(GV)) in classifyLocalReference() 123 if (GV && (GV->isDeclarationForLinker() || GV->hasCommonLinkage())) in classifyLocalReference() 139 if (GV) { in classifyGlobalReference() 151 if (TM.shouldAssumeDSOLocal(M, GV)) in classifyGlobalReference() 152 return classifyLocalReference(GV); in classifyGlobalReference() 156 if (!GV) in classifyGlobalReference() 175 if (AllowTaggedGlobals && GV && !isa<Function>(GV)) in classifyGlobalReference() 195 return classifyGlobalFunctionReference(GV, *GV->getParent()); in classifyGlobalFunctionReference() 201 if (TM.shouldAssumeDSOLocal(M, GV)) in classifyGlobalFunctionReference() [all …]
|
| /llvm-project-15.0.7/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 …]
|
| /llvm-project-15.0.7/llvm/lib/IR/ |
| H A D | Mangler.cpp | 122 if (GV->hasPrivateLinkage()) { in getNameWithPrefix() 130 if (!GV->hasName()) { in getNameWithPrefix() 133 unsigned &ID = AnonGlobalIDs[GV]; in getNameWithPrefix() 142 StringRef Name = GV->getName(); in getNameWithPrefix() 213 if (!GV->hasDLLExportStorageClass() || GV->isDeclaration()) in emitLinkerFlagsForGlobalCOFF() 221 bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); in emitLinkerFlagsForGlobalCOFF() 227 Mangler.getNameWithPrefix(FlagOS, GV, false); in emitLinkerFlagsForGlobalCOFF() 234 Mangler.getNameWithPrefix(OS, GV, false); in emitLinkerFlagsForGlobalCOFF() 239 if (!GV->getValueType()->isFunctionTy()) { in emitLinkerFlagsForGlobalCOFF() 253 bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); in emitLinkerFlagsForUsedCOFF() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/AMDGPU/ |
| H A D | AMDGPUReplaceLDSUseWithPointer.cpp | 164 LDSToNonKernels[GV] = AMDGPU::collectNonKernelAccessorsOfLDS(GV); in shouldIgnorePointerReplacement() 165 return LDSToNonKernels[GV].empty(); in shouldIgnorePointerReplacement() 192 LDSToPointer[GV] = LDSPointer; in createLDSPointer() 318 GV->getType()); in getReplacementInst() 322 FunctionToLDSToReplaceInst[F][GV] = V; in getReplacementInst() 343 bool replaceLDSUse(GlobalVariable *GV); 374 LDSPointer = createLDSPointer(GV); in replaceLDSUse() 377 initializeLDSPointer(K, GV, LDSPointer); in replaceLDSUse() 388 replaceLDSUseByPointer(GV, LDSPointer); in replaceLDSUse() 596 for (auto *GV : LDSGlobals) in replaceLDSUse() local [all …]
|
| H A D | AMDGPUMachineFunction.cpp | 53 auto Entry = LocalMemoryObjects.insert(std::make_pair(&GV, 0)); in allocateLDSGlobal() 58 DL.getValueOrABITypeAlignment(GV.getAlign(), GV.getValueType()); in allocateLDSGlobal() 61 if (GV.getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) { in allocateLDSGlobal() 67 StaticLDSSize += DL.getTypeAllocSize(GV.getValueType()); in allocateLDSGlobal() 73 assert(GV.getAddressSpace() == AMDGPUAS::REGION_ADDRESS && in allocateLDSGlobal() 77 StaticGDSSize += DL.getTypeAllocSize(GV.getValueType()); in allocateLDSGlobal() 96 if (GV && !canElideModuleLDS(F)) { in allocateModuleLDSGlobal() 97 unsigned Offset = allocateLDSGlobal(M->getDataLayout(), *GV); in allocateModuleLDSGlobal() 121 const GlobalVariable &GV) { in setDynLDSAlign() argument 122 assert(DL.getTypeAllocSize(GV.getValueType()).isZero()); in setDynLDSAlign() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Object/ |
| H A D | ModuleSymbolTable.cpp | 61 SymTab.push_back(&GV); in addModule() 182 auto *GV = S.get<GlobalValue *>(); in printSymbolName() local 193 auto *GV = S.get<GlobalValue *>(); in getSymbolFlags() local 196 if (GV->isDeclarationForLinker()) in getSymbolFlags() 198 else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage()) in getSymbolFlags() 207 if (isa<GlobalAlias>(GV)) in getSymbolFlags() 209 if (GV->hasPrivateLinkage()) in getSymbolFlags() 211 if (!GV->hasLocalLinkage()) in getSymbolFlags() 213 if (GV->hasCommonLinkage()) in getSymbolFlags() 215 if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() || in getSymbolFlags() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/NVPTX/ |
| H A D | NVPTXGenericToNVVM.cpp | 79 !llvm::isTexture(GV) && !llvm::isSurface(GV) && !llvm::isSampler(GV) && in runOnModule() 80 !GV.getName().startswith("llvm.")) { in runOnModule() 82 M, GV.getValueType(), GV.isConstant(), GV.getLinkage(), in runOnModule() 83 GV.hasInitializer() ? GV.getInitializer() : nullptr, "", &GV, in runOnModule() 85 NewGV->copyAttributesFrom(&GV); in runOnModule() 87 GVMap[&GV] = NewGV; in runOnModule() 129 GlobalVariable *GV = I->first; in runOnModule() local 142 GV->replaceAllUsesWith(BitCastNewGV); in runOnModule() 144 GV->eraseFromParent(); in runOnModule() 170 GlobalVariable *GV = I->second; in remapConstant() local [all …]
|
| /llvm-project-15.0.7/llvm/lib/LTO/ |
| H A D | LTOCodeGenerator.cpp | 368 if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || in preserveDiscardableGVs() 378 Used.push_back(&GV); in preserveDiscardableGVs() 381 mayPreserveGlobal(GV); in preserveDiscardableGVs() 403 if (!GV.hasName()) in applyScopeRestrictions() 426 if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() && in applyScopeRestrictions() 427 GV.hasName()) in applyScopeRestrictions() 428 ExternalSymbols.insert(std::make_pair(GV.getName(), GV.getLinkage())); in applyScopeRestrictions() 431 RecordLinkage(GV); in applyScopeRestrictions() 433 RecordLinkage(GV); in applyScopeRestrictions() 435 RecordLinkage(GV); in applyScopeRestrictions() [all …]
|
| /llvm-project-15.0.7/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()) 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()
|
| /llvm-project-15.0.7/llvm/test/CodeGen/Mips/GlobalISel/legalizer/ |
| H A D | load_4_unaligned.mir | 71 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align1 76 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align1 93 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align2 115 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align4 137 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align8 159 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align1 164 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align1 181 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align2 186 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align2 203 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align4 [all …]
|