Skip to content

Commit a884946

Browse files
author
chengjunp
committed
format
1 parent 1d1e3d3 commit a884946

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,8 +2703,7 @@ static Value *insertVector(IRBuilderTy &IRB, Value *Old, Value *V,
27032703
/// \return A new vector containing all elements from V0 followed by all
27042704
/// elements from V1
27052705
static Value *mergeTwoVectors(Value *V0, Value *V1, const DataLayout &DL,
2706-
Type *NewAIEltTy,
2707-
IRBuilder<> &Builder) {
2706+
Type *NewAIEltTy, IRBuilder<> &Builder) {
27082707
assert(V0->getType()->isVectorTy() && V1->getType()->isVectorTy() &&
27092708
"Can not merge two non-vector values");
27102709

@@ -2723,8 +2722,7 @@ static Value *mergeTwoVectors(Value *V0, Value *V1, const DataLayout &DL,
27232722
// Calculate new number of elements to maintain same bit width
27242723
unsigned TotalBits =
27252724
VecType->getNumElements() * DL.getTypeSizeInBits(EltType);
2726-
unsigned NewNumElts =
2727-
TotalBits / DL.getTypeSizeInBits(NewAIEltTy);
2725+
unsigned NewNumElts = TotalBits / DL.getTypeSizeInBits(NewAIEltTy);
27282726

27292727
auto *NewVecType = FixedVectorType::get(NewAIEltTy, NewNumElts);
27302728
V = Builder.CreateBitCast(V, NewVecType);
@@ -3011,11 +3009,12 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
30113009
Type *StoredValueType = SI->getValueOperand()->getType();
30123010
if (!isa<FixedVectorType>(StoredValueType))
30133011
return std::nullopt;
3014-
3012+
30153013
// The total number of stored bits should be the multiple of the new
30163014
// alloca element type size
30173015
if (DL.getTypeSizeInBits(StoredValueType) %
3018-
DL.getTypeSizeInBits(AllocatedEltTy) != 0)
3016+
DL.getTypeSizeInBits(AllocatedEltTy) !=
3017+
0)
30193018
return std::nullopt;
30203019
// If the stored value is a pointer, we do not handle it
30213020
// TODO: handle this case by using inttoptr/ptrtoint

0 commit comments

Comments
 (0)