File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3236,11 +3236,9 @@ bool LoopVectorizationCostModel::isScalarWithPredication(
32363236
32373237// TODO: Fold into LoopVectorizationLegality::isMaskRequired.
32383238bool LoopVectorizationCostModel::isPredicatedInst (Instruction *I) const {
3239- // If predication is not needed, avoid it.
32403239 // TODO: We can use the loop-preheader as context point here and get
32413240 // context sensitive reasoning for isSafeToSpeculativelyExecute.
3242- if (!blockNeedsPredicationForAnyReason (I->getParent ()) ||
3243- isSafeToSpeculativelyExecute (I) ||
3241+ if (isSafeToSpeculativelyExecute (I) ||
32443242 (isa<LoadInst, StoreInst, CallInst>(I) && !Legal->isMaskRequired (I)) ||
32453243 isa<BranchInst, SwitchInst, PHINode, AllocaInst>(I))
32463244 return false ;
@@ -3250,6 +3248,10 @@ bool LoopVectorizationCostModel::isPredicatedInst(Instruction *I) const {
32503248 if (Legal->blockNeedsPredication (I->getParent ()))
32513249 return true ;
32523250
3251+ // If we're not folding the tail by masking, predication is unnecessary.
3252+ if (!foldTailByMasking ())
3253+ return false ;
3254+
32533255 // All that remain are instructions with side-effects originally executed in
32543256 // the loop unconditionally, but now execute under a tail-fold mask (only)
32553257 // having at least one active lane (the first). If the side-effects of the
You can’t perform that action at this time.
0 commit comments