Lines Matching refs:Globals

140     bool doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
144 bool doMerge(const SmallVectorImpl<GlobalVariable *> &Globals,
202 bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals, in doMerge() argument
206 std::stable_sort(Globals.begin(), Globals.end(), in doMerge()
214 BitVector AllGlobals(Globals.size()); in doMerge()
216 return doMerge(Globals, AllGlobals, M, isConst, AddrSpace); in doMerge()
239 UsedGlobalSet(size_t Size) : Globals(Size), UsageCount(1) {} in doMerge()
240 BitVector Globals; in doMerge() member
249 UsedGlobalSets.emplace_back(Globals.size()); in doMerge()
277 for (size_t GI = 0, GE = Globals.size(); GI != GE; ++GI) { in doMerge()
278 GlobalVariable *GV = Globals[GI]; in doMerge()
327 CreateGlobalSet().Globals.set(GI); in doMerge()
337 if (UsedGlobalSets[UGSIdx].Globals.test(GI)) { in doMerge()
359 NewUGS.Globals.set(GI); in doMerge()
360 NewUGS.Globals |= UsedGlobalSets[UGSIdx].Globals; in doMerge()
373 return UGS1.Globals.count() * UGS1.UsageCount < in doMerge()
374 UGS2.Globals.count() * UGS2.UsageCount; in doMerge()
381 BitVector AllGlobals(Globals.size()); in doMerge()
386 if (UGS.Globals.count() > 1) in doMerge()
387 AllGlobals |= UGS.Globals; in doMerge()
389 return doMerge(Globals, AllGlobals, M, isConst, AddrSpace); in doMerge()
398 BitVector PickedGlobals(Globals.size()); in doMerge()
405 if (PickedGlobals.anyCommon(UGS.Globals)) in doMerge()
407 PickedGlobals |= UGS.Globals; in doMerge()
411 if (UGS.Globals.count() < 2) in doMerge()
413 Changed |= doMerge(Globals, UGS.Globals, M, isConst, AddrSpace); in doMerge()
419 bool GlobalMerge::doMerge(const SmallVectorImpl<GlobalVariable *> &Globals, in doMerge() argument
422 assert(Globals.size() > 1); in doMerge()
438 Type *Ty = Globals[j]->getValueType(); in doMerge()
444 Inits.push_back(Globals[j]->getInitializer()); in doMerge()
455 GlobalValue::LinkageTypes Linkage = Globals[k]->getLinkage(); in doMerge()
456 std::string Name = Globals[k]->getName(); in doMerge()
464 Globals[k]->replaceAllUsesWith(GEP); in doMerge()
465 Globals[k]->eraseFromParent(); in doMerge()
528 DenseMap<unsigned, SmallVector<GlobalVariable*, 16> > Globals, ConstGlobals, in doInitialization() local
570 Globals[AddressSpace].push_back(&GV); in doInitialization()
574 for (auto &P : Globals) in doInitialization()