Lines Matching defs:GV

72                             const GlobalValue *GV, const User *U) {
77 GVtoClusterMap.unionSets(GV, F);
79 GVtoClusterMap.unionSets(GV, GVU);
85 // Adds all GlobalValue users of V to the same cluster as GV.
87 const GlobalValue *GV, const Value *V) {
93 // For each constant that is not a GV (a pure const) recurse.
98 addNonConstUser(GVtoClusterMap, GV, UU);
103 static const GlobalObject *getGVPartitioningRoot(const GlobalValue *GV) {
104 const GlobalObject *GO = GV->getAliaseeObject();
124 auto recordGVSet = [&GVtoClusterMap, &ComdatMembers](GlobalValue &GV) {
125 if (GV.isDeclaration())
128 if (!GV.hasName())
129 GV.setName("__llvmsplit_unnamed");
135 if (const Comdat *C = GV.getComdat()) {
138 GVtoClusterMap.unionSets(Member, &GV);
140 Member = &GV;
145 if (const GlobalObject *Root = getGVPartitioningRoot(&GV))
146 if (&GV != Root)
147 GVtoClusterMap.unionSets(&GV, Root);
149 if (const Function *F = dyn_cast<Function>(&GV)) {
158 if (GV.hasLocalLinkage())
159 addAllGlobalValueUsers(GVtoClusterMap, &GV, &GV);
221 static void externalize(GlobalValue *GV) {
222 if (GV->hasLocalLinkage()) {
223 GV->setLinkage(GlobalValue::ExternalLinkage);
224 GV->setVisibility(GlobalValue::HiddenVisibility);
229 if (!GV->hasName())
230 GV->setName("__llvmsplit_unnamed");
233 // Returns whether GV should be in partition (0-based) I of N.
234 static bool isInPartition(const GlobalValue *GV, unsigned I, unsigned N) {
235 if (const GlobalObject *Root = getGVPartitioningRoot(GV))
236 GV = Root;
239 if (const Comdat *C = GV->getComdat())
242 Name = GV->getName();
261 for (GlobalVariable &GV : M.globals())
262 externalize(&GV);
315 CloneModule(M, VMap, [&](const GlobalValue *GV) {
316 if (auto It = ClusterIDMap.find(GV); It != ClusterIDMap.end())
319 return isInPartition(GV, I, N);