Skip to content

Commit 60e71f3

Browse files
committed
Remove calls to AllocSize()
1 parent accd941 commit 60e71f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,15 +915,15 @@ bool LegalizeBufferContentTypesVisitor::visitLoadImpl(
915915
}
916916
if (auto *AT = dyn_cast<ArrayType>(PartType)) {
917917
Type *ElemTy = AT->getElementType();
918-
TypeSize AllocSize = DL.getTypeAllocSize(ElemTy);
919918
if (!ElemTy->isSingleValueType() ||
920-
DL.getTypeSizeInBits(ElemTy) != 8 * AllocSize || ElemTy->isVectorTy()) {
919+
!DL.typeSizeEqualsStoreSize(ElemTy) || ElemTy->isVectorTy()) {
920+
TypeSize ElemStoreSize = DL.getTypeStoreSize(ElemTy);
921921
bool Changed = false;
922922
for (auto I : llvm::iota_range<uint32_t>(0, AT->getNumElements(),
923923
/*Inclusive=*/false)) {
924924
AggIdxs.push_back(I);
925925
Changed |= visitLoadImpl(OrigLI, ElemTy, AggIdxs,
926-
AggByteOff + I * AllocSize.getFixedValue(),
926+
AggByteOff + I * ElemStoreSize.getFixedValue(),
927927
Result, Name + Twine(I));
928928
AggIdxs.pop_back();
929929
}

0 commit comments

Comments
 (0)