@@ -56,9 +56,9 @@ STATISTIC(NumScalarOps, "Number of scalar unary + binary ops formed");
5656STATISTIC (NumScalarCmp, " Number of scalar compares formed" );
5757STATISTIC (NumScalarIntrinsic, " Number of scalar intrinsic calls formed" );
5858
59- static cl::opt<bool > DisableVectorCombine (
60- " disable-vector-combine" , cl::init(false ), cl::Hidden,
61- cl::desc(" Disable all vector combine transforms" ));
59+ static cl::opt<bool >
60+ DisableVectorCombine ( " disable-vector-combine" , cl::init(false ), cl::Hidden,
61+ cl::desc(" Disable all vector combine transforms" ));
6262
6363static cl::opt<bool > DisableBinopExtractShuffle (
6464 " disable-binop-extract-shuffle" , cl::init(false ), cl::Hidden,
@@ -1074,8 +1074,7 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
10741074 InstructionCost OldCost = 2 * SplatCost + VectorOpCost;
10751075
10761076 // Determine scalar opcode
1077- std::optional<unsigned > FunctionalOpcode =
1078- VPI.getFunctionalOpcode ();
1077+ std::optional<unsigned > FunctionalOpcode = VPI.getFunctionalOpcode ();
10791078 std::optional<Intrinsic::ID> ScalarIntrID = std::nullopt ;
10801079 if (!FunctionalOpcode) {
10811080 ScalarIntrID = VPI.getFunctionalIntrinsicID ();
@@ -1098,8 +1097,7 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
10981097 (SplatCost * !Op0->hasOneUse ()) + (SplatCost * !Op1->hasOneUse ());
10991098 InstructionCost NewCost = ScalarOpCost + SplatCost + CostToKeepSplats;
11001099
1101- LLVM_DEBUG (dbgs () << " Found a VP Intrinsic to scalarize: " << VPI
1102- << " \n " );
1100+ LLVM_DEBUG (dbgs () << " Found a VP Intrinsic to scalarize: " << VPI << " \n " );
11031101 LLVM_DEBUG (dbgs () << " Cost of Intrinsic: " << OldCost
11041102 << " , Cost of scalarizing:" << NewCost << " \n " );
11051103
@@ -1820,11 +1818,11 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
18201818 Builder.SetInsertPoint (EI);
18211819 Value *GEP =
18221820 Builder.CreateInBoundsGEP (VecTy, Ptr, {Builder.getInt32 (0 ), Idx});
1823- auto *NewLoad = cast<LoadInst>(Builder. CreateLoad (
1824- ElemType, GEP, EI->getName () + " .scalar" ));
1821+ auto *NewLoad = cast<LoadInst>(
1822+ Builder. CreateLoad ( ElemType, GEP, EI->getName () + " .scalar" ));
18251823
1826- Align ScalarOpAlignment = computeAlignmentAfterScalarization (
1827- LI->getAlign (), ElemType, Idx, *DL);
1824+ Align ScalarOpAlignment =
1825+ computeAlignmentAfterScalarization ( LI->getAlign (), ElemType, Idx, *DL);
18281826 NewLoad->setAlignment (ScalarOpAlignment);
18291827
18301828 if (auto *ConstIdx = dyn_cast<ConstantInt>(Idx)) {
@@ -2078,10 +2076,12 @@ bool VectorCombine::foldPermuteOfBinops(Instruction &I) {
20782076 }
20792077
20802078 unsigned NumOpElts = Op0Ty->getNumElements ();
2081- bool IsIdentity0 = ShuffleDstTy == Op0Ty &&
2079+ bool IsIdentity0 =
2080+ ShuffleDstTy == Op0Ty &&
20822081 all_of (NewMask0, [NumOpElts](int M) { return M < (int )NumOpElts; }) &&
20832082 ShuffleVectorInst::isIdentityMask (NewMask0, NumOpElts);
2084- bool IsIdentity1 = ShuffleDstTy == Op1Ty &&
2083+ bool IsIdentity1 =
2084+ ShuffleDstTy == Op1Ty &&
20852085 all_of (NewMask1, [NumOpElts](int M) { return M < (int )NumOpElts; }) &&
20862086 ShuffleVectorInst::isIdentityMask (NewMask1, NumOpElts);
20872087
0 commit comments