@@ -869,18 +869,16 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
869869 }
870870
871871 unsigned ElementSizeInBits = DL->getTypeSizeInBits (ElemTy);
872- if (ElementSizeInBits == 0 ) {
873- LLVM_DEBUG (dbgs () << " Cannot create vector of zero-sized elements." );
874- return false ;
875- }
876872 if (ElementSizeInBits != DL->getTypeAllocSizeInBits (ElemTy)) {
877873 LLVM_DEBUG (dbgs () << " Cannot convert to vector if the allocation size "
878874 " does not match the type's size\n " );
879875 return false ;
880876 }
881877 unsigned ElementSize = ElementSizeInBits / 8 ;
882- if (ElementSize == 0 )
878+ if (ElementSize == 0 ) {
879+ LLVM_DEBUG (dbgs () << " Cannot create vector of zero-sized elements\n " );
883880 return false ;
881+ }
884882
885883 // Calculate the size of the corresponding vector, accounting for padding of
886884 // inner types, e.g., odd-sized subvectors. Storage size of new vector must
@@ -889,11 +887,12 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
889887 unsigned AllocaSize = DL->getTypeStoreSize (AllocaTy);
890888 unsigned NumElems = AllocaSize / ElementSize;
891889 if (NumElems == 0 ) {
892- LLVM_DEBUG (dbgs () << " Cannot vectorize an empty aggregate type. " );
890+ LLVM_DEBUG (dbgs () << " Cannot vectorize an empty aggregate type\n " );
893891 return false ;
894892 }
895893 if (NumElems * ElementSize != AllocaSize) {
896- LLVM_DEBUG (dbgs () << " Cannot convert type into vector of the same size." );
894+ LLVM_DEBUG (
895+ dbgs () << " Cannot convert type into vector of the same size\n " );
897896 return false ;
898897 }
899898 auto *VectorTy = FixedVectorType::get (ElemTy, NumElems);
0 commit comments