[llvm] ba9016a - [LV] Replace redundant tail-fold check with assert (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 29 10:02:49 PST 2021


Author: Florian Hahn
Date: 2021-12-29T19:00:41+01:00
New Revision: ba9016a0304630cbf36c7838a3916d03fc8396c6

URL: https://github.com/llvm/llvm-project/commit/ba9016a0304630cbf36c7838a3916d03fc8396c6
DIFF: https://github.com/llvm/llvm-project/commit/ba9016a0304630cbf36c7838a3916d03fc8396c6.diff

LOG: [LV] Replace redundant tail-fold check with assert (NFC).

The code path can only be reached when folding the tail, so turn the
check into an assertion.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 112e697c7f5ee..5635b1596bace 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8458,9 +8458,9 @@ VPValue *VPRecipeBuilder::createBlockInMask(BasicBlock *BB, VPlanPtr &Plan) {
     auto NewInsertionPoint = Builder.getInsertBlock()->getFirstNonPhi();
     Builder.setInsertPoint(Builder.getInsertBlock(), NewInsertionPoint);
 
-    bool TailFolded = !CM.isScalarEpilogueAllowed();
+    assert(CM.foldTailByMasking() && "must fold the tail");
 
-    if (TailFolded && CM.TTI.emitGetActiveLaneMask()) {
+    if (CM.TTI.emitGetActiveLaneMask()) {
       VPValue *TC = Plan->getOrCreateTripCount();
       BlockMask = Builder.createNaryOp(VPInstruction::ActiveLaneMask, {IV, TC});
     } else {


        


More information about the llvm-commits mailing list