[llvm] 8936d86 - [LV] Add debug output for force scalar tracing [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 15:18:02 PDT 2022


Author: Philip Reames
Date: 2022-08-29T15:17:51-07:00
New Revision: 8936d86469d2bf168988296820a331b1410f7143

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

LOG: [LV] Add debug output for force scalar tracing [nfc]

I keep finding myself needing to rule this out as a possible source of scalarization, so add debug output like we have for other instructions we decide to scalarize.

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 27f21e0d393b..a9f67b600f18 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4332,8 +4332,10 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
   // induction variable when the PHI user is scalarized.
   auto ForcedScalar = ForcedScalars.find(VF);
   if (ForcedScalar != ForcedScalars.end())
-    for (auto *I : ForcedScalar->second)
+    for (auto *I : ForcedScalar->second) {
+      LLVM_DEBUG(dbgs() << "LV: Found (forced) scalar instruction: " << *I << "\n");
       Worklist.insert(I);
+    }
 
   // Expand the worklist by looking through any bitcasts and getelementptr
   // instructions we've already identified as scalar. This is similar to the


        


More information about the llvm-commits mailing list