@@ -40,10 +40,10 @@ static cl::opt<bool>
40
40
EnableIfConversion (" enable-if-conversion" , cl::init(true ), cl::Hidden,
41
41
cl::desc(" Enable if-conversion during vectorization." ));
42
42
43
- static cl::opt<bool >
44
- AllowStridedPointerIVs ( " lv-strided-pointer-ivs" , cl::init(false ), cl::Hidden,
45
- cl::desc(" Enable recognition of non-constant strided "
46
- " pointer induction variables." ));
43
+ static cl::opt<bool > AllowStridedPointerIVs (
44
+ " lv-strided-pointer-ivs" , cl::init(false ), cl::Hidden,
45
+ cl::desc(" Enable recognition of non-constant strided "
46
+ " pointer induction variables." ));
47
47
48
48
static cl::opt<bool >
49
49
HintsAllowReordering (" hints-allow-reordering" , cl::init(true ), cl::Hidden,
@@ -420,8 +420,8 @@ static IntegerType *getWiderInductionTy(const DataLayout &DL, Type *Ty0,
420
420
// / identified reduction variable.
421
421
static bool hasOutsideLoopUser (const Loop *TheLoop, Instruction *Inst,
422
422
SmallPtrSetImpl<Value *> &AllowedExit) {
423
- // Reductions, Inductions and non-header phis are allowed to have exit users. All
424
- // other instructions must not have external users.
423
+ // Reductions, Inductions and non-header phis are allowed to have exit users.
424
+ // All other instructions must not have external users.
425
425
if (!AllowedExit.count (Inst))
426
426
// Check that all of the users of the loop are inside the BB.
427
427
for (User *U : Inst->users ()) {
@@ -459,12 +459,13 @@ int LoopVectorizationLegality::isConsecutivePtr(Type *AccessTy,
459
459
// pointer is checked to reference consecutive elements suitable for a
460
460
// masked access.
461
461
const auto &Strides =
462
- LAI ? LAI->getSymbolicStrides () : DenseMap<Value *, const SCEV *>();
462
+ LAI ? LAI->getSymbolicStrides () : DenseMap<Value *, const SCEV *>();
463
463
464
464
bool CanAddPredicate = !llvm::shouldOptimizeForSize (
465
465
TheLoop->getHeader (), PSI, BFI, PGSOQueryType::IRPass);
466
- int Stride = getPtrStride (PSE, AccessTy, Ptr, TheLoop, Strides,
467
- CanAddPredicate, false ).value_or (0 );
466
+ int Stride =
467
+ getPtrStride (PSE, AccessTy, Ptr, TheLoop, Strides, CanAddPredicate, false )
468
+ .value_or (0 );
468
469
if (Stride == 1 || Stride == -1 )
469
470
return Stride;
470
471
return 0 ;
@@ -622,7 +623,8 @@ bool LoopVectorizationLegality::canVectorizeOuterLoop() {
622
623
// not supported yet.
623
624
auto *Br = dyn_cast<BranchInst>(BB->getTerminator ());
624
625
if (!Br) {
625
- reportVectorizationFailure (" Unsupported basic block terminator" ,
626
+ reportVectorizationFailure (
627
+ " Unsupported basic block terminator" ,
626
628
" loop control flow is not understood by vectorizer" ,
627
629
" CFGNotUnderstood" , ORE, TheLoop);
628
630
if (DoExtraAnalysis)
@@ -641,7 +643,8 @@ bool LoopVectorizationLegality::canVectorizeOuterLoop() {
641
643
!TheLoop->isLoopInvariant (Br->getCondition ()) &&
642
644
!LI->isLoopHeader (Br->getSuccessor (0 )) &&
643
645
!LI->isLoopHeader (Br->getSuccessor (1 ))) {
644
- reportVectorizationFailure (" Unsupported conditional branch" ,
646
+ reportVectorizationFailure (
647
+ " Unsupported conditional branch" ,
645
648
" loop control flow is not understood by vectorizer" ,
646
649
" CFGNotUnderstood" , ORE, TheLoop);
647
650
if (DoExtraAnalysis)
@@ -655,9 +658,10 @@ bool LoopVectorizationLegality::canVectorizeOuterLoop() {
655
658
// simple outer loops scenarios with uniform nested loops.
656
659
if (!isUniformLoopNest (TheLoop /* loop nest*/ ,
657
660
TheLoop /* context outer loop*/ )) {
658
- reportVectorizationFailure (" Outer loop contains divergent loops" ,
659
- " loop control flow is not understood by vectorizer" ,
660
- " CFGNotUnderstood" , ORE, TheLoop);
661
+ reportVectorizationFailure (
662
+ " Outer loop contains divergent loops" ,
663
+ " loop control flow is not understood by vectorizer" , " CFGNotUnderstood" ,
664
+ ORE, TheLoop);
661
665
if (DoExtraAnalysis)
662
666
Result = false ;
663
667
else
@@ -1623,9 +1627,10 @@ bool LoopVectorizationLegality::canVectorizeLoopCFG(Loop *Lp,
1623
1627
// We must have a loop in canonical form. Loops with indirectbr in them cannot
1624
1628
// be canonicalized.
1625
1629
if (!Lp->getLoopPreheader ()) {
1626
- reportVectorizationFailure (" Loop doesn't have a legal pre-header" ,
1627
- " loop control flow is not understood by vectorizer" ,
1628
- " CFGNotUnderstood" , ORE, TheLoop);
1630
+ reportVectorizationFailure (
1631
+ " Loop doesn't have a legal pre-header" ,
1632
+ " loop control flow is not understood by vectorizer" , " CFGNotUnderstood" ,
1633
+ ORE, TheLoop);
1629
1634
if (DoExtraAnalysis)
1630
1635
Result = false ;
1631
1636
else
@@ -1634,9 +1639,10 @@ bool LoopVectorizationLegality::canVectorizeLoopCFG(Loop *Lp,
1634
1639
1635
1640
// We must have a single backedge.
1636
1641
if (Lp->getNumBackEdges () != 1 ) {
1637
- reportVectorizationFailure (" The loop must have a single backedge" ,
1638
- " loop control flow is not understood by vectorizer" ,
1639
- " CFGNotUnderstood" , ORE, TheLoop);
1642
+ reportVectorizationFailure (
1643
+ " The loop must have a single backedge" ,
1644
+ " loop control flow is not understood by vectorizer" , " CFGNotUnderstood" ,
1645
+ ORE, TheLoop);
1640
1646
if (DoExtraAnalysis)
1641
1647
Result = false ;
1642
1648
else
@@ -2049,7 +2055,8 @@ bool LoopVectorizationLegality::canVectorize(bool UseVPlanNativePath) {
2049
2055
if (PSE.getPredicate ().getComplexity () > SCEVThreshold) {
2050
2056
LLVM_DEBUG (dbgs () << " LV: Vectorization not profitable "
2051
2057
" due to SCEVThreshold" );
2052
- reportVectorizationFailure (" Too many SCEV checks needed" ,
2058
+ reportVectorizationFailure (
2059
+ " Too many SCEV checks needed" ,
2053
2060
" Too many SCEV assumptions need to be made and checked at runtime" ,
2054
2061
" TooManySCEVRunTimeChecks" , ORE, TheLoop);
2055
2062
if (DoExtraAnalysis)
0 commit comments