Lines Matching refs:GV
49 bool lowerGlobal(GlobalVariable *GV);
110 static bool rewriteNonInstructionUses(GlobalVariable *GV, Pass *P) { in rewriteNonInstructionUses() argument
112 for (User *U : GV->users()) in rewriteNonInstructionUses()
129 bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) { in lowerGlobal() argument
130 Module *M = GV->getParent(); in lowerGlobal()
131 if (!GV->isThreadLocal()) in lowerGlobal()
135 if (!rewriteNonInstructionUses(GV, this) || in lowerGlobal()
136 !GV->getType()->isSized() || isZeroLengthArray(GV->getType())) in lowerGlobal()
140 ArrayType *NewType = createLoweredType(GV->getValueType()); in lowerGlobal()
142 if (GV->hasInitializer()) in lowerGlobal()
144 GV->getInitializer()); in lowerGlobal()
146 new GlobalVariable(*M, NewType, GV->isConstant(), GV->getLinkage(), in lowerGlobal()
149 GV->getType()->getAddressSpace(), in lowerGlobal()
150 GV->isExternallyInitialized()); in lowerGlobal()
153 SmallVector<User *, 16> Users(GV->users()); in lowerGlobal()
158 Function *GetID = Intrinsic::getDeclaration(GV->getParent(), in lowerGlobal()
163 U->replaceUsesOfWith(GV, Addr); in lowerGlobal()
167 NewGV->takeName(GV); in lowerGlobal()
168 GV->eraseFromParent(); in lowerGlobal()
176 for (GlobalVariable &GV : M.globals()) in runOnModule()
177 if (GV.isThreadLocal()) in runOnModule()
178 ThreadLocalGlobals.push_back(&GV); in runOnModule()