diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2929,7 +2929,7 @@ } /// Maps a specific scalar to its tree entry. - SmallDenseMap ScalarToTreeEntry; + SmallDenseMap ScalarToTreeEntry; /// Maps a value to the proposed vectorizable size. SmallDenseMap InstrElementSize; @@ -3381,7 +3381,6 @@ << "SLP: gets ready (ctl): " << *DepBundle << "\n"); } } - } } @@ -4962,7 +4961,7 @@ // Check if the stores are consecutive by checking if their difference is 1. for (unsigned Idx : seq(1, StoreOffsetVec.size())) - if (StoreOffsetVec[Idx].second != StoreOffsetVec[Idx-1].second + 1) + if (StoreOffsetVec[Idx].second != StoreOffsetVec[Idx - 1].second + 1) return false; // Calculate the shuffle indices according to their offset against the sorted @@ -5999,7 +5998,7 @@ } Function *F = CI->getCalledFunction(); unsigned NumArgs = CI->arg_size(); - SmallVector ScalarArgs(NumArgs, nullptr); + SmallVector ScalarArgs(NumArgs, nullptr); for (unsigned j = 0; j != NumArgs; ++j) if (isVectorIntrinsicWithScalarOpAtArg(ID, j)) ScalarArgs[j] = CI->getArgOperand(j); @@ -6641,9 +6640,9 @@ if (auto *SV2 = dyn_cast(Op2)) { SmallVector ExtMask1(Mask.size(), PoisonMaskElem); for (auto [Idx, I] : enumerate(CombinedMask1)) { - if (I == PoisonMaskElem) + if (I == PoisonMaskElem) continue; - ExtMask1[Idx] = SV1->getMaskValue(I); + ExtMask1[Idx] = SV1->getMaskValue(I); } SmallBitVector UseMask1 = buildUseMask( cast(SV1->getOperand(1)->getType()) @@ -6651,9 +6650,9 @@ ExtMask1, UseMask::SecondArg); SmallVector ExtMask2(CombinedMask2.size(), PoisonMaskElem); for (auto [Idx, I] : enumerate(CombinedMask2)) { - if (I == PoisonMaskElem) + if (I == PoisonMaskElem) continue; - ExtMask2[Idx] = SV2->getMaskValue(I); + ExtMask2[Idx] = SV2->getMaskValue(I); } SmallBitVector UseMask2 = buildUseMask( cast(SV2->getOperand(1)->getType()) @@ -6733,7 +6732,7 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis { bool IsFinalized = false; SmallVector CommonMask; - SmallVector , 2> InVectors; + SmallVector, 2> InVectors; const TargetTransformInfo &TTI; InstructionCost Cost = 0; ArrayRef VectorizedVals; @@ -8083,7 +8082,7 @@ unsigned BundleWidth = VectorizableTree.front()->Scalars.size(); InstructionCost Cost = 0; - SmallPtrSet LiveValues; + SmallPtrSet LiveValues; Instruction *PrevInst = nullptr; // The entries in VectorizableTree are not necessarily ordered by their @@ -8176,7 +8175,7 @@ } if (NumCalls) { - SmallVector V; + SmallVector V; for (auto *II : LiveValues) { auto *ScalarTy = II->getType(); if (auto *VectorTy = dyn_cast(ScalarTy)) @@ -10076,7 +10075,7 @@ // PHINodes may have multiple entries from the same block. We want to // visit every block once. - SmallPtrSet VisitedBBs; + SmallPtrSet VisitedBBs; for (unsigned i = 0, e = PH->getNumIncomingValues(); i < e; ++i) { ValueList Operands; @@ -10178,13 +10177,13 @@ NumElts != NumScalars) { if (IsFirstUndef.all()) { if (!ShuffleVectorInst::isIdentityMask(InsertMask)) { - SmallBitVector IsFirstPoison = - isUndefVector(FirstInsert->getOperand(0), UseMask); - if (!IsFirstPoison.all()) { - for (unsigned I = 0; I < NumElts; I++) { - if (InsertMask[I] == PoisonMaskElem && !IsFirstPoison.test(I)) - InsertMask[I] = I + NumElts; - } + SmallBitVector IsFirstPoison = + isUndefVector(FirstInsert->getOperand(0), UseMask); + if (!IsFirstPoison.all()) { + for (unsigned I = 0; I < NumElts; I++) { + if (InsertMask[I] == PoisonMaskElem && !IsFirstPoison.test(I)) + InsertMask[I] = I + NumElts; + } } V = Builder.CreateShuffleVector( V, @@ -10481,7 +10480,7 @@ CallInst *CI = cast(VL0); setInsertPointAfterBundle(E); - Intrinsic::ID IID = Intrinsic::not_intrinsic; + Intrinsic::ID IID = Intrinsic::not_intrinsic; if (Function *FI = CI->getCalledFunction()) IID = FI->getIntrinsicID(); @@ -10639,7 +10638,7 @@ return V; } default: - llvm_unreachable("unknown inst"); + llvm_unreachable("unknown inst"); } return nullptr; } @@ -11663,7 +11662,7 @@ unsigned numAliased = 0; unsigned DistToSrc = 1; - for ( ; DepDest; DepDest = DepDest->NextLoadStore) { + for (; DepDest; DepDest = DepDest->NextLoadStore) { assert(isInSchedulingRegion(DepDest)); // We have two limits to reduce the complexity: @@ -13588,7 +13587,7 @@ // possible problem with poison propagation. If not possible to reorder // (both operands are originally RHS), emit an extra freeze instruction // for the LHS operand. - //I.e., if we have original code like this: + // I.e., if we have original code like this: // RedOp1 = select i1 ?, i1 LHS, i1 false // RedOp2 = select i1 RHS, i1 ?, i1 false