Lines Matching defs:GV
49 bool hasKnownAlignment(GlobalVariable *GV) const;
53 unsigned getAlignment(GlobalVariable *GV) const;
75 GlobalValue *GV = cast<GlobalValue>(Operand);
76 UsedValues.insert(GV);
92 bool ConstantMerge::hasKnownAlignment(GlobalVariable *GV) const {
93 return DL || GV->getAlignment() != 0;
96 unsigned ConstantMerge::getAlignment(GlobalVariable *GV) const {
97 unsigned Align = GV->getAlignment();
101 return DL->getPreferredAlignment(GV);
133 GlobalVariable *GV = GVI++;
135 // If this GV is dead, remove it.
136 GV->removeDeadConstantUsers();
137 if (GV->use_empty() && GV->hasLocalLinkage()) {
138 GV->eraseFromParent();
143 if (!GV->isConstant() || !GV->hasDefinitiveInitializer() ||
144 GV->getType()->getAddressSpace() != 0 || GV->hasSection() ||
146 UsedGlobals.count(GV))
153 if (GV->isWeakForLinker())
156 Constant *Init = GV->getInitializer();
159 PointerIntPair<Constant*, 1, bool> Pair(Init, hasKnownAlignment(GV));
165 if (!Slot || IsBetterCanonical(*GV, *Slot))
166 Slot = GV;
175 GlobalVariable *GV = GVI++;
178 if (!GV->isConstant() || !GV->hasDefinitiveInitializer() ||
179 GV->getType()->getAddressSpace() != 0 || GV->hasSection() ||
181 UsedGlobals.count(GV))
185 if (!GV->hasLocalLinkage())
188 Constant *Init = GV->getInitializer();
191 PointerIntPair<Constant*, 1, bool> Pair(Init, hasKnownAlignment(GV));
194 if (!Slot || Slot == GV)
197 if (!Slot->hasUnnamedAddr() && !GV->hasUnnamedAddr())
200 if (!GV->hasUnnamedAddr())
204 Replacements.push_back(std::make_pair(GV, Slot));