[llvm] c543480 - [VectorCombine] foldInsExtVectorToShuffle - add debug message for match + cost-comparison

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 05:33:07 PST 2024


Author: Simon Pilgrim
Date: 2024-12-20T13:32:49Z
New Revision: c5434804eeea643f0420bc5fd83dd4977731f4d2

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

LOG: [VectorCombine] foldInsExtVectorToShuffle - add debug message for match + cost-comparison

Helps with debugging to show to that the fold found the match, and shows the old + new costs to indicate whether the fold was/wasn't profitable.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 9ea8190cfb49db..aa3dff0c0a89ed 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -3003,6 +3003,10 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
   if (!Ext->hasOneUse())
     NewCost += TTI.getVectorInstrCost(*Ext, VecTy, CostKind, ExtIdx);
 
+  LLVM_DEBUG(dbgs() << "Found a insert/extract shuffle-like pair : " << I
+                    << "\n  OldCost: " << OldCost << " vs NewCost: " << NewCost
+                    << "\n");
+
   if (OldCost < NewCost)
     return false;
 


        


More information about the llvm-commits mailing list