• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/llvmCore-3425.0.33/lib/Transforms/InstCombine/

Lines Matching defs:AI

145 isOnlyCopiedFromConstantGlobal(AllocaInst *AI,
148 if (isOnlyCopiedFromConstantGlobal(AI, TheCopy, ToDelete))
172 Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
176 Type *IntPtrTy = TD->getIntPtrType(AI.getContext());
177 if (AI.getArraySize()->getType() != IntPtrTy) {
178 Value *V = Builder->CreateIntCast(AI.getArraySize(),
180 AI.setOperand(0, V);
181 return &AI;
186 if (AI.isArrayAllocation()) { // Check C != 1
187 if (const ConstantInt *C = dyn_cast<ConstantInt>(AI.getArraySize())) {
189 ArrayType::get(AI.getAllocatedType(), C->getZExtValue());
190 AllocaInst *New = Builder->CreateAlloca(NewTy, 0, AI.getName());
191 New->setAlignment(AI.getAlignment());
202 Value *NullIdx =Constant::getNullValue(Type::getInt32Ty(AI.getContext()));
212 return ReplaceInstUsesWith(AI, GEP);
213 } else if (isa<UndefValue>(AI.getArraySize())) {
214 return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
218 if (TD && AI.getAllocatedType()->isSized()) {
220 if (AI.getAlignment() == 0)
221 AI.setAlignment(TD->getPrefTypeAlignment(AI.getAllocatedType()));
226 if (TD->getTypeAllocSize(AI.getAllocatedType()) == 0) {
230 if (AI.isArrayAllocation()) {
231 AI.setOperand(0, ConstantInt::get(AI.getArraySize()->getType(), 1));
232 return &AI;
236 BasicBlock &EntryBlock = AI.getParent()->getParent()->getEntryBlock();
238 if (FirstInst != &AI) {
245 AI.moveBefore(FirstInst);
246 return &AI;
258 AI.getAlignment());
260 if (AI.getType() != EntryAI->getType())
261 return new BitCastInst(EntryAI, AI.getType());
262 return ReplaceInstUsesWith(AI, EntryAI);
275 if (MemTransferInst *Copy = isOnlyCopiedFromConstantGlobal(&AI, ToDelete)) {
276 if (AI.getAlignment() <= getPointeeAlignment(Copy->getSource(), *TD)) {
277 DEBUG(dbgs() << "Found alloca equal to global: " << AI << '\n');
283 = ReplaceInstUsesWith(AI, ConstantExpr::getBitCast(TheSrc,
284 AI.getType()));
294 return visitAllocSite(AI);