Lines Matching defs:GV

77     const GlobalValue &GV) const {
78 if (!GV.hasLocalLinkage())
81 if (GV.hasSection())
83 if (Used.count(const_cast<GlobalValue *>(&GV)))
195 void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
198 if (GV.hasName()) {
199 VI = ImportIndex.getValueInfo(GV.getGUID());
202 if (Function *F = dyn_cast<Function>(&GV)) {
218 GV.setDSOLocal(true);
219 if (GV.hasDLLImportStorageClass())
220 GV.setDLLStorageClass(GlobalValue::DefaultStorageClass);
224 // We should always have a ValueInfo (i.e. GV in index) for definitions when
226 assert(VI || GV.isDeclaration() ||
227 (isPerformingImport() && !doImportAsDefinition(&GV)));
236 // propagateConstants hasn't been run. We can't internalize GV
238 if (!GV.isDeclaration() && VI && ImportIndex.withAttributePropagation()) {
239 if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) {
254 // Objects referenced by writeonly GV initializer should not be
256 // on behalf of this writeonly GV. To avoid promotion we convert
257 // GV initializer to 'zeroinitializer'. This effectively drops
267 if (GV.hasLocalLinkage() && shouldPromoteLocalToGlobal(&GV, VI)) {
268 // Save the original name string before we rename GV below.
269 auto Name = GV.getName().str();
270 GV.setName(getPromotedName(&GV));
271 GV.setLinkage(getLinkage(&GV, /* DoPromote */ true));
272 assert(!GV.hasLocalLinkage());
273 GV.setVisibility(GlobalValue::HiddenVisibility);
277 if (const auto *C = GV.getComdat())
279 RenamedComdats.try_emplace(C, M.getOrInsertComdat(GV.getName()));
281 GV.setLinkage(getLinkage(&GV, /* DoPromote */ false));
286 auto *GO = dyn_cast<GlobalObject>(&GV);
298 for (GlobalVariable &GV : M.globals())
299 processGlobalForThinLTO(GV);