Lines Matching refs:GV
46 bool lowerGlobal(GlobalVariable *GV);
74 static bool hasNonInstructionUse(GlobalVariable *GV) {
75 for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end(); UI != E;
88 bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {
89 Module *M = GV->getParent();
91 if (!GV->isThreadLocal())
95 if (hasNonInstructionUse(GV) ||
96 !GV->getType()->isSized() || isZeroLengthArray(GV->getType()))
100 ArrayType *NewType = createLoweredType(GV->getType()->getElementType());
102 GV->getInitializer());
104 new GlobalVariable(*M, NewType, GV->isConstant(), GV->getLinkage(),
106 GV->getType()->getAddressSpace(),
107 GV->isExternallyInitialized());
110 SmallVector<User *, 16> Users(GV->use_begin(), GV->use_end());
115 Function *GetID = Intrinsic::getDeclaration(GV->getParent(),
122 U->replaceUsesOfWith(GV, Addr);
126 NewGV->takeName(GV);
127 GV->eraseFromParent();
137 GlobalVariable *GV = GVI;
138 if (GV->isThreadLocal())
139 ThreadLocalGlobals.push_back(GV);