reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
342 if (auto *I = simplifyAllocaArraySize(*this, AI)) 345 if (AI.getAllocatedType()->isSized()) { 347 if (AI.getAlignment() == 0) 348 AI.setAlignment( 349 MaybeAlign(DL.getPrefTypeAlignment(AI.getAllocatedType()))); 354 if (DL.getTypeAllocSize(AI.getAllocatedType()) == 0) { 358 if (AI.isArrayAllocation()) { 359 AI.setOperand(0, ConstantInt::get(AI.getArraySize()->getType(), 1)); 359 AI.setOperand(0, ConstantInt::get(AI.getArraySize()->getType(), 1)); 360 return &AI; 364 BasicBlock &EntryBlock = AI.getParent()->getParent()->getEntryBlock(); 366 if (FirstInst != &AI) { 373 AI.moveBefore(FirstInst); 374 return &AI; 386 std::max(EntryAI->getAlignment(), AI.getAlignment())); 388 if (AI.getType() != EntryAI->getType()) 389 return new BitCastInst(EntryAI, AI.getType()); 390 return replaceInstUsesWith(AI, EntryAI); 395 if (AI.getAlignment()) { 403 if (MemTransferInst *Copy = isOnlyCopiedFromConstantGlobal(&AI, ToDelete)) { 405 Copy->getSource(), AI.getAlignment(), DL, &AI, &AC, &DT); 405 Copy->getSource(), AI.getAlignment(), DL, &AI, &AC, &DT); 406 if (AI.getAlignment() <= SourceAlign && 407 isDereferenceableForAllocaSize(Copy->getSource(), &AI, DL)) { 408 LLVM_DEBUG(dbgs() << "Found alloca equal to global: " << AI << '\n'); 414 auto *DestTy = PointerType::get(AI.getType()->getPointerElementType(), 418 if (AI.getType()->getPointerAddressSpace() == 420 Instruction *NewI = replaceInstUsesWith(AI, Cast); 426 PtrReplacer.replacePointer(AI, Cast); 435 return visitAllocSite(AI);