if (!IsOffsetKnown)
return PI.setAborted(&LI);
- if (isa<ScalableVectorType>(LI.getType()))
+ TypeSize Size = DL.getTypeStoreSize(LI.getType());
+ if (Size.isScalable())
return PI.setAborted(&LI);
- uint64_t Size = DL.getTypeStoreSize(LI.getType()).getFixedValue();
- return handleLoadOrStore(LI.getType(), LI, Offset, Size, LI.isVolatile());
+ return handleLoadOrStore(LI.getType(), LI, Offset, Size.getFixedValue(),
+ LI.isVolatile());
}
void visitStoreInst(StoreInst &SI) {
if (!IsOffsetKnown)
return PI.setAborted(&SI);
- if (isa<ScalableVectorType>(ValOp->getType()))
+ TypeSize StoreSize = DL.getTypeStoreSize(ValOp->getType());
+ if (StoreSize.isScalable())
return PI.setAborted(&SI);
- uint64_t Size = DL.getTypeStoreSize(ValOp->getType()).getFixedValue();
+ uint64_t Size = StoreSize.getFixedValue();
// If this memory access can be shown to *statically* extend outside the
// bounds of the allocation, it's behavior is undefined, so simply
// Skip alloca forms that this analysis can't handle.
auto *AT = AI.getAllocatedType();
- if (AI.isArrayAllocation() || !AT->isSized() || isa<ScalableVectorType>(AT) ||
- DL.getTypeAllocSize(AT).getFixedValue() == 0)
+ TypeSize Size = DL.getTypeAllocSize(AT);
+ if (AI.isArrayAllocation() || !AT->isSized() || Size.isScalable() ||
+ Size.getFixedValue() == 0)
return {Changed, CFGChanged};
// First, split any FCA loads and stores touching this alloca to promote
DTU = &RunDTU;
AC = &RunAC;
+ const DataLayout &DL = F.getParent()->getDataLayout();
BasicBlock &EntryBB = F.getEntryBlock();
for (BasicBlock::iterator I = EntryBB.begin(), E = std::prev(EntryBB.end());
I != E; ++I) {
if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) {
- if (isa<ScalableVectorType>(AI->getAllocatedType())) {
- if (isAllocaPromotable(AI))
- PromotableAllocas.push_back(AI);
- } else {
+ if (DL.getTypeAllocSize(AI->getAllocatedType()).isScalable() &&
+ isAllocaPromotable(AI))
+ PromotableAllocas.push_back(AI);
+ else
Worklist.insert(AI);
- }
}
}