Lines Matching refs:DL
242 AllocaSlices(const DataLayout &DL, AllocaInst &AI);
671 SliceBuilder(const DataLayout &DL, AllocaInst &AI, AllocaSlices &AS) in SliceBuilder() argument
672 : PtrUseVisitor<SliceBuilder>(DL), in SliceBuilder()
673 AllocSize(DL.getTypeAllocSize(AI.getAllocatedType())), AS(AS) {} in SliceBuilder()
737 const DataLayout &DL = GEPI.getModule()->getDataLayout(); in visitGetElementPtrInst() local
748 const StructLayout *SL = DL.getStructLayout(STy); in visitGetElementPtrInst()
756 DL.getTypeAllocSize(GTI.getIndexedType())); in visitGetElementPtrInst()
787 const DataLayout &DL = LI.getModule()->getDataLayout(); in visitLoadInst() local
788 uint64_t Size = DL.getTypeStoreSize(LI.getType()); in visitLoadInst()
799 const DataLayout &DL = SI.getModule()->getDataLayout(); in visitStoreInst() local
800 uint64_t Size = DL.getTypeStoreSize(ValOp->getType()); in visitStoreInst()
936 const DataLayout &DL = Root->getModule()->getDataLayout(); in hasUnsafePHIOrSelectUse() local
945 Size = std::max(Size, DL.getTypeStoreSize(LI->getType())); in hasUnsafePHIOrSelectUse()
952 Size = std::max(Size, DL.getTypeStoreSize(Op->getType())); in hasUnsafePHIOrSelectUse()
1031 AllocaSlices::AllocaSlices(const DataLayout &DL, AllocaInst &AI) in AllocaSlices() argument
1037 SliceBuilder PB(DL, AI, *this); in AllocaSlices()
1207 const DataLayout &DL = PN.getModule()->getDataLayout(); in isSafePHIToSpeculate() local
1230 if (isSafeToLoadUnconditionally(InVal, MaxAlign, DL, TI)) in isSafePHIToSpeculate()
1310 const DataLayout &DL = SI.getModule()->getDataLayout(); in isSafeSelectToSpeculate() local
1320 if (!isSafeToLoadUnconditionally(TValue, LI->getAlignment(), DL, LI)) in isSafeSelectToSpeculate()
1322 if (!isSafeToLoadUnconditionally(FValue, LI->getAlignment(), DL, LI)) in isSafeSelectToSpeculate()
1395 static Value *getNaturalGEPWithType(IRBuilderTy &IRB, const DataLayout &DL, in getNaturalGEPWithType() argument
1403 unsigned OffsetSize = DL.getIndexTypeSizeInBits(BasePtr->getType()); in getNaturalGEPWithType()
1439 static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL, in getNaturalGEPRecursively() argument
1445 return getNaturalGEPWithType(IRB, DL, Ptr, Ty, TargetTy, Indices, in getNaturalGEPRecursively()
1456 unsigned ElementSizeInBits = DL.getTypeSizeInBits(VecTy->getScalarType()); in getNaturalGEPRecursively()
1467 return getNaturalGEPRecursively(IRB, DL, Ptr, VecTy->getElementType(), in getNaturalGEPRecursively()
1473 APInt ElementSize(Offset.getBitWidth(), DL.getTypeAllocSize(ElementTy)); in getNaturalGEPRecursively()
1480 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy, in getNaturalGEPRecursively()
1488 const StructLayout *SL = DL.getStructLayout(STy); in getNaturalGEPRecursively()
1495 if (Offset.uge(DL.getTypeAllocSize(ElementTy))) in getNaturalGEPRecursively()
1499 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy, in getNaturalGEPRecursively()
1513 static Value *getNaturalGEPWithOffset(IRBuilderTy &IRB, const DataLayout &DL, in getNaturalGEPWithOffset() argument
1527 APInt ElementSize(Offset.getBitWidth(), DL.getTypeAllocSize(ElementTy)); in getNaturalGEPWithOffset()
1534 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy, in getNaturalGEPWithOffset()
1553 static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr, in getAdjustedPtr() argument
1578 if (!GEP->accumulateConstantOffset(DL, GEPOffset)) in getAdjustedPtr()
1588 if (Value *P = getNaturalGEPWithOffset(IRB, DL, Ptr, Offset, TargetTy, in getAdjustedPtr()
1649 const DataLayout &DL) { in getAdjustedAlignment() argument
1663 Alignment = DL.getABITypeAlignment(Ty); in getAdjustedAlignment()
1674 static bool canConvertValue(const DataLayout &DL, Type *OldTy, Type *NewTy) { in canConvertValue() argument
1688 if (DL.getTypeSizeInBits(NewTy) != DL.getTypeSizeInBits(OldTy)) in canConvertValue()
1706 return !DL.isNonIntegralPointerType(NewTy); in canConvertValue()
1710 if (!DL.isNonIntegralPointerType(OldTy)) in canConvertValue()
1725 static Value *convertValue(const DataLayout &DL, IRBuilderTy &IRB, Value *V, in convertValue() argument
1728 assert(canConvertValue(DL, OldTy, NewTy) && "Value not convertable to type"); in convertValue()
1741 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)), in convertValue()
1746 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)), in convertValue()
1757 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)), in convertValue()
1762 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)), in convertValue()
1778 const DataLayout &DL) { in isVectorPromotionViableForSlice() argument
1822 if (!canConvertValue(DL, SliceTy, LTy)) in isVectorPromotionViableForSlice()
1832 if (!canConvertValue(DL, STy, SliceTy)) in isVectorPromotionViableForSlice()
1850 static VectorType *isVectorPromotionViable(Partition &P, const DataLayout &DL) { in isVectorPromotionViable() argument
1897 auto RankVectorTypes = [&DL](VectorType *RHSTy, VectorType *LHSTy) { in isVectorPromotionViable()
1898 (void)DL; in isVectorPromotionViable()
1899 assert(DL.getTypeSizeInBits(RHSTy) == DL.getTypeSizeInBits(LHSTy) && in isVectorPromotionViable()
1927 uint64_t ElementSize = DL.getTypeSizeInBits(VTy->getElementType()); in isVectorPromotionViable()
1933 assert((DL.getTypeSizeInBits(VTy) % 8) == 0 && in isVectorPromotionViable()
1938 if (!isVectorPromotionViableForSlice(P, S, VTy, ElementSize, DL)) in isVectorPromotionViable()
1942 if (!isVectorPromotionViableForSlice(P, *S, VTy, ElementSize, DL)) in isVectorPromotionViable()
1961 const DataLayout &DL, in isIntegerWideningViableForSlice() argument
1963 uint64_t Size = DL.getTypeStoreSize(AllocaTy); in isIntegerWideningViableForSlice()
1979 if (DL.getTypeStoreSize(LI->getType()) > Size) in isIntegerWideningViableForSlice()
1991 if (ITy->getBitWidth() < DL.getTypeStoreSizeInBits(ITy)) in isIntegerWideningViableForSlice()
1994 !canConvertValue(DL, AllocaTy, LI->getType())) { in isIntegerWideningViableForSlice()
2004 if (DL.getTypeStoreSize(ValueTy) > Size) in isIntegerWideningViableForSlice()
2016 if (ITy->getBitWidth() < DL.getTypeStoreSizeInBits(ITy)) in isIntegerWideningViableForSlice()
2019 !canConvertValue(DL, ValueTy, AllocaTy)) { in isIntegerWideningViableForSlice()
2046 const DataLayout &DL) { in isIntegerWideningViable() argument
2047 uint64_t SizeInBits = DL.getTypeSizeInBits(AllocaTy); in isIntegerWideningViable()
2053 if (SizeInBits != DL.getTypeStoreSizeInBits(AllocaTy)) in isIntegerWideningViable()
2060 if (!canConvertValue(DL, AllocaTy, IntTy) || in isIntegerWideningViable()
2061 !canConvertValue(DL, IntTy, AllocaTy)) in isIntegerWideningViable()
2072 P.begin() != P.end() ? false : DL.isLegalInteger(SizeInBits); in isIntegerWideningViable()
2075 if (!isIntegerWideningViableForSlice(S, P.beginOffset(), AllocaTy, DL, in isIntegerWideningViable()
2080 if (!isIntegerWideningViableForSlice(*S, P.beginOffset(), AllocaTy, DL, in isIntegerWideningViable()
2087 static Value *extractInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *V, in extractInteger() argument
2092 assert(DL.getTypeStoreSize(Ty) + Offset <= DL.getTypeStoreSize(IntTy) && in extractInteger()
2095 if (DL.isBigEndian()) in extractInteger()
2096 ShAmt = 8 * (DL.getTypeStoreSize(IntTy) - DL.getTypeStoreSize(Ty) - Offset); in extractInteger()
2110 static Value *insertInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *Old, in insertInteger() argument
2121 assert(DL.getTypeStoreSize(Ty) + Offset <= DL.getTypeStoreSize(IntTy) && in insertInteger()
2124 if (DL.isBigEndian()) in insertInteger()
2125 ShAmt = 8 * (DL.getTypeStoreSize(IntTy) - DL.getTypeStoreSize(Ty) - Offset); in insertInteger()
2227 const DataLayout &DL; member in llvm::sroa::AllocaSliceRewriter
2277 AllocaSliceRewriter(const DataLayout &DL, AllocaSlices &AS, SROA &Pass, in AllocaSliceRewriter() argument
2284 : DL(DL), AS(AS), Pass(Pass), OldAI(OldAI), NewAI(NewAI), in AllocaSliceRewriter()
2291 DL.getTypeSizeInBits(NewAI.getAllocatedType())) in AllocaSliceRewriter()
2295 ElementSize(VecTy ? DL.getTypeSizeInBits(ElementTy) / 8 : 0), in AllocaSliceRewriter()
2299 assert((DL.getTypeSizeInBits(ElementTy) % 8) == 0 && in AllocaSliceRewriter()
2376 return getAdjustedPtr(IRB, DL, &NewAI, in getNewAllocaSlicePtr()
2377 APInt(DL.getIndexTypeSizeInBits(PointerTy), Offset), in getNewAllocaSlicePtr()
2395 NewAIAlign = DL.getABITypeAlignment(NewAI.getAllocatedType()); in getSliceAlign()
2398 return (Ty && Align == DL.getABITypeAlignment(Ty)) ? 0 : Align; in getSliceAlign()
2429 V = convertValue(DL, IRB, V, IntTy); in rewriteIntegerLoad()
2434 V = extractInteger(DL, IRB, V, ExtractTy, Offset, "extract"); in rewriteIntegerLoad()
2460 const bool IsLoadPastEnd = DL.getTypeStoreSize(TargetTy) > SliceSize; in visitLoadInst()
2469 (canConvertValue(DL, NewAllocaTy, TargetTy) || in visitLoadInst()
2502 if (DL.isBigEndian()) in visitLoadInst()
2519 V = convertValue(DL, IRB, V, TargetTy); in visitLoadInst()
2525 assert(SliceSize < DL.getTypeStoreSize(LI.getType()) && in visitLoadInst()
2528 DL.getTypeStoreSizeInBits(LI.getType()) && in visitLoadInst()
2538 V = insertInteger(DL, IRB, Placeholder, V, NewBeginOffset - BeginOffset, in visitLoadInst()
2565 V = convertValue(DL, IRB, V, SliceTy); in rewriteVectorizedStoreInst()
2583 if (DL.getTypeSizeInBits(V->getType()) != IntTy->getBitWidth()) { in rewriteIntegerStore()
2586 Old = convertValue(DL, IRB, Old, IntTy); in rewriteIntegerStore()
2589 V = insertInteger(DL, IRB, Old, SI.getValueOperand(), Offset, "insert"); in rewriteIntegerStore()
2591 V = convertValue(DL, IRB, V, NewAllocaTy); in rewriteIntegerStore()
2618 if (SliceSize < DL.getTypeStoreSize(V->getType())) { in visitStoreInst()
2623 DL.getTypeStoreSizeInBits(V->getType()) && in visitStoreInst()
2626 V = extractInteger(DL, IRB, V, NarrowTy, NewBeginOffset - BeginOffset, in visitStoreInst()
2635 const bool IsStorePastEnd = DL.getTypeStoreSize(V->getType()) > SliceSize; in visitStoreInst()
2639 (canConvertValue(DL, V->getType(), NewAllocaTy) || in visitStoreInst()
2648 if (DL.isBigEndian()) in visitStoreInst()
2654 V = convertValue(DL, IRB, V, NewAllocaTy); in visitStoreInst()
2739 SliceSize != DL.getTypeStoreSize(AllocaTy) || in visitMemSetInst()
2741 !DL.isLegalInteger(DL.getTypeSizeInBits(ScalarTy)) || in visitMemSetInst()
2742 DL.getTypeSizeInBits(ScalarTy) % 8 != 0)) { in visitMemSetInst()
2772 getIntegerSplat(II.getValue(), DL.getTypeSizeInBits(ElementTy) / 8); in visitMemSetInst()
2773 Splat = convertValue(DL, IRB, Splat, ElementTy); in visitMemSetInst()
2792 Old = convertValue(DL, IRB, Old, IntTy); in visitMemSetInst()
2794 V = insertInteger(DL, IRB, Old, V, Offset, "insert"); in visitMemSetInst()
2799 V = convertValue(DL, IRB, V, AllocaTy); in visitMemSetInst()
2805 V = getIntegerSplat(II.getValue(), DL.getTypeSizeInBits(ScalarTy) / 8); in visitMemSetInst()
2809 V = convertValue(DL, IRB, V, AllocaTy); in visitMemSetInst()
2868 SliceSize != DL.getTypeStoreSize(NewAI.getAllocatedType()) || in visitMemTransferInst()
2901 unsigned OffsetWidth = DL.getIndexSizeInBits(OtherAS); in visitMemTransferInst()
2911 OtherPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy, in visitMemTransferInst()
2964 Value *SrcPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy, in visitMemTransferInst()
2980 Src = convertValue(DL, IRB, Src, IntTy); in visitMemTransferInst()
2982 Src = extractInteger(DL, IRB, Src, SubIntTy, Offset, "extract"); in visitMemTransferInst()
2998 Old = convertValue(DL, IRB, Old, IntTy); in visitMemTransferInst()
3000 Src = insertInteger(DL, IRB, Old, Src, Offset, "insert"); in visitMemTransferInst()
3001 Src = convertValue(DL, IRB, Src, NewAllocaTy); in visitMemTransferInst()
3064 LoadAlign = DL.getABITypeAlignment(LI->getType()); in fixLoadStoreAlign()
3072 StoreAlign = DL.getABITypeAlignment(Op->getType()); in fixLoadStoreAlign()
3169 const DataLayout &DL; member in __anon241d746d0a11::AggLoadStoreRewriter
3172 AggLoadStoreRewriter(const DataLayout &DL) : DL(DL) {} in AggLoadStoreRewriter() argument
3225 const DataLayout &DL; member in __anon241d746d0a11::AggLoadStoreRewriter::OpSplitter
3230 unsigned BaseAlign, const DataLayout &DL) in OpSplitter() argument
3232 BaseTy(BaseTy), BaseAlign(BaseAlign), DL(DL) {} in OpSplitter()
3250 unsigned Offset = DL.getIndexedOffsetInType(BaseTy, GEPIndices); in emitSplitOps()
3293 AAMDNodes AATags, unsigned BaseAlign, const DataLayout &DL) in LoadOpSplitter()
3295 DL), AATags(AATags) {} in LoadOpSplitter()
3322 getAdjustedAlignment(&LI, 0, DL), DL); in visitLoadInst()
3332 AAMDNodes AATags, unsigned BaseAlign, const DataLayout &DL) in StoreOpSplitter()
3334 DL), in StoreOpSplitter()
3369 getAdjustedAlignment(&SI, 0, DL), DL); in visitStoreInst()
3403 static Type *stripAggregateTypeWrapping(const DataLayout &DL, Type *Ty) { in stripAggregateTypeWrapping() argument
3407 uint64_t AllocSize = DL.getTypeAllocSize(Ty); in stripAggregateTypeWrapping()
3408 uint64_t TypeSize = DL.getTypeSizeInBits(Ty); in stripAggregateTypeWrapping()
3414 const StructLayout *SL = DL.getStructLayout(STy); in stripAggregateTypeWrapping()
3421 if (AllocSize > DL.getTypeAllocSize(InnerTy) || in stripAggregateTypeWrapping()
3422 TypeSize > DL.getTypeSizeInBits(InnerTy)) in stripAggregateTypeWrapping()
3425 return stripAggregateTypeWrapping(DL, InnerTy); in stripAggregateTypeWrapping()
3441 static Type *getTypePartition(const DataLayout &DL, Type *Ty, uint64_t Offset, in getTypePartition() argument
3443 if (Offset == 0 && DL.getTypeAllocSize(Ty) == Size) in getTypePartition()
3444 return stripAggregateTypeWrapping(DL, Ty); in getTypePartition()
3445 if (Offset > DL.getTypeAllocSize(Ty) || in getTypePartition()
3446 (DL.getTypeAllocSize(Ty) - Offset) < Size) in getTypePartition()
3451 uint64_t ElementSize = DL.getTypeAllocSize(ElementTy); in getTypePartition()
3463 return getTypePartition(DL, ElementTy, Offset, Size); in getTypePartition()
3468 return stripAggregateTypeWrapping(DL, ElementTy); in getTypePartition()
3480 const StructLayout *SL = DL.getStructLayout(STy); in getTypePartition()
3491 uint64_t ElementSize = DL.getTypeAllocSize(ElementTy); in getTypePartition()
3499 return getTypePartition(DL, ElementTy, Offset, Size); in getTypePartition()
3504 return stripAggregateTypeWrapping(DL, ElementTy); in getTypePartition()
3527 const StructLayout *SubSL = DL.getStructLayout(SubTy); in getTypePartition()
3771 const DataLayout &DL = AI.getModule()->getDataLayout(); in presplitLoadsAndStores() local
3798 getAdjustedPtr(IRB, DL, BasePtr, in presplitLoadsAndStores()
3799 APInt(DL.getIndexSizeInBits(AS), PartOffset), in presplitLoadsAndStores()
3801 getAdjustedAlignment(LI, PartOffset, DL), /*IsVolatile*/ false, in presplitLoadsAndStores()
3856 getAdjustedPtr(IRB, DL, StoreBasePtr, in presplitLoadsAndStores()
3857 APInt(DL.getIndexSizeInBits(AS), PartOffset), in presplitLoadsAndStores()
3859 getAdjustedAlignment(SI, PartOffset, DL), /*IsVolatile*/ false); in presplitLoadsAndStores()
3939 getAdjustedPtr(IRB, DL, LoadBasePtr, in presplitLoadsAndStores()
3940 APInt(DL.getIndexSizeInBits(AS), PartOffset), in presplitLoadsAndStores()
3942 getAdjustedAlignment(LI, PartOffset, DL), /*IsVolatile*/ false, in presplitLoadsAndStores()
3951 getAdjustedPtr(IRB, DL, StoreBasePtr, in presplitLoadsAndStores()
3952 APInt(DL.getIndexSizeInBits(AS), PartOffset), in presplitLoadsAndStores()
3954 getAdjustedAlignment(SI, PartOffset, DL), /*IsVolatile*/ false); in presplitLoadsAndStores()
4053 const DataLayout &DL = AI.getModule()->getDataLayout(); in rewritePartition() local
4055 if (DL.getTypeAllocSize(CommonUseTy) >= P.size()) in rewritePartition()
4058 if (Type *TypePartitionTy = getTypePartition(DL, AI.getAllocatedType(), in rewritePartition()
4063 DL.isLegalInteger(P.size() * 8)) in rewritePartition()
4067 assert(DL.getTypeAllocSize(SliceTy) >= P.size()); in rewritePartition()
4069 bool IsIntegerPromotable = isIntegerWideningViable(P, SliceTy, DL); in rewritePartition()
4072 IsIntegerPromotable ? nullptr : isVectorPromotionViable(P, DL); in rewritePartition()
4094 Alignment = DL.getABITypeAlignment(AI.getAllocatedType()); in rewritePartition()
4099 if (Alignment <= DL.getABITypeAlignment(SliceTy)) in rewritePartition()
4121 AllocaSliceRewriter Rewriter(DL, AS, *this, AI, *NewAI, P.beginOffset(), in rewritePartition()
4196 const DataLayout &DL = AI.getModule()->getDataLayout(); in splitAlloca() local
4209 uint64_t AllocaSize = DL.getTypeAllocSize(AI.getAllocatedType()); in splitAlloca()
4273 uint64_t AllocaSize = DL.getTypeSizeInBits(NewAI->getAllocatedType()); in splitAlloca()
4293 uint64_t AllocaSize = DL.getTypeSizeInBits(AI.getAllocatedType()); in splitAlloca()
4378 const DataLayout &DL = AI.getModule()->getDataLayout(); in runOnAlloca() local
4382 DL.getTypeAllocSize(AI.getAllocatedType()) == 0) in runOnAlloca()
4389 AggLoadStoreRewriter AggRewriter(DL); in runOnAlloca()
4393 AllocaSlices AS(DL, AI); in runOnAlloca()