Lines Matching refs:GV

48     bool hasKnownAlignment(GlobalVariable *GV) const;
52 unsigned getAlignment(GlobalVariable *GV) const;
74 GlobalValue *GV = cast<GlobalValue>(Operand); in FindUsedValues() local
75 UsedValues.insert(GV); in FindUsedValues()
91 bool ConstantMerge::hasKnownAlignment(GlobalVariable *GV) const { in hasKnownAlignment()
92 return TD || GV->getAlignment() != 0; in hasKnownAlignment()
95 unsigned ConstantMerge::getAlignment(GlobalVariable *GV) const { in getAlignment()
96 unsigned Align = GV->getAlignment(); in getAlignment()
100 return TD->getPreferredAlignment(GV); in getAlignment()
131 GlobalVariable *GV = GVI++; in runOnModule() local
134 GV->removeDeadConstantUsers(); in runOnModule()
135 if (GV->use_empty() && GV->hasLocalLinkage()) { in runOnModule()
136 GV->eraseFromParent(); in runOnModule()
141 if (!GV->isConstant() || !GV->hasDefinitiveInitializer() || in runOnModule()
142 GV->getType()->getAddressSpace() != 0 || GV->hasSection() || in runOnModule()
144 UsedGlobals.count(GV)) in runOnModule()
151 if (GV->isWeakForLinker()) in runOnModule()
154 Constant *Init = GV->getInitializer(); in runOnModule()
157 PointerIntPair<Constant*, 1, bool> Pair(Init, hasKnownAlignment(GV)); in runOnModule()
163 if (Slot == 0 || IsBetterCannonical(*GV, *Slot)) in runOnModule()
164 Slot = GV; in runOnModule()
173 GlobalVariable *GV = GVI++; in runOnModule() local
176 if (!GV->isConstant() || !GV->hasDefinitiveInitializer() || in runOnModule()
177 GV->getType()->getAddressSpace() != 0 || GV->hasSection() || in runOnModule()
179 UsedGlobals.count(GV)) in runOnModule()
183 if (!GV->hasLocalLinkage()) in runOnModule()
186 Constant *Init = GV->getInitializer(); in runOnModule()
189 PointerIntPair<Constant*, 1, bool> Pair(Init, hasKnownAlignment(GV)); in runOnModule()
192 if (!Slot || Slot == GV) in runOnModule()
195 if (!Slot->hasUnnamedAddr() && !GV->hasUnnamedAddr()) in runOnModule()
198 if (!GV->hasUnnamedAddr()) in runOnModule()
202 Replacements.push_back(std::make_pair(GV, Slot)); in runOnModule()