[llvm] b7b1e5c - [LV] Assert that the executed plan contains selected VF & UF (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 03:46:32 PST 2022


Author: Florian Hahn
Date: 2022-12-23T11:44:42Z
New Revision: b7b1e5c96fe05bad7cb68fdaea21d2b88ce7f2d1

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

LOG: [LV] Assert that the executed plan contains selected VF & UF (NFC).

Add assertion to ensure the executed plan is valid for the selected VF
and UF.

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 636306eb58994..f19444163d181 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7611,6 +7611,11 @@ void LoopVectorizationPlanner::executePlan(ElementCount BestVF, unsigned BestUF,
                                            InnerLoopVectorizer &ILV,
                                            DominatorTree *DT,
                                            bool IsEpilogueVectorization) {
+  assert(BestVPlan.hasVF(BestVF) &&
+         "Trying to execute plan with unsupported VF");
+  assert(BestVPlan.hasUF(BestUF) &&
+         "Trying to execute plan with unsupported UF");
+
   LLVM_DEBUG(dbgs() << "Executing best plan with VF=" << BestVF << ", UF=" << BestUF
                     << '\n');
 


        


More information about the llvm-commits mailing list