[llvm] a7efe06 - [LV] Assert no DbgInfoIntrinsic calls are passed to widening (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 03:38:49 PDT 2020


Author: Florian Hahn
Date: 2020-04-09T11:37:32+01:00
New Revision: a7efe06af0f5ee860a582885c678b4ef981b6b2c

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

LOG: [LV] Assert no DbgInfoIntrinsic calls are passed to widening (NFC).

When building a VPlan, BasicBlock::instructionsWithoutDebug() is used to
iterate over the instructions in a block. This means that no recipes
should be created for debug info intrinsics already and we can turn the
early exit into an assertion.

Reviewers: Ayal, gilr, rengolin, aprantl

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D77636

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 c807ec10c99e..d41e9c37bc01 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4362,11 +4362,8 @@ void InnerLoopVectorizer::widenInstruction(Instruction &I) {
 
 void InnerLoopVectorizer::widenCallInstruction(CallInst &I, VPUser &ArgOperands,
                                                VPTransformState &State) {
-  // Ignore dbg intrinsics.
-  // TODO: Debug intrinsics should be skipped/handled during VPlan construction
-  // rather than dropping them here.
-  if (isa<DbgInfoIntrinsic>(I))
-    return;
+  assert(!isa<DbgInfoIntrinsic>(I) &&
+         "DbgInfoIntrinsic should have been dropped during VPlan construction");
   setDebugLocFromInst(Builder, &I);
 
   Module *M = I.getParent()->getParent()->getParent();
@@ -7247,6 +7244,7 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
     Builder.setInsertPoint(VPBB);
 
     // Introduce each ingredient into VPlan.
+    // TODO: Model and preserve debug instrinsics in VPlan.
     for (Instruction &I : BB->instructionsWithoutDebug()) {
       Instruction *Instr = &I;
 


        


More information about the llvm-commits mailing list