[llvm] b153bed - [VectorCombine] foldShuffleChainsToReduce - add dbg cost comparison message (#199233)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 10:11:30 PDT 2026


Author: Simon Pilgrim
Date: 2026-05-22T17:11:25Z
New Revision: b153bed8fae4db1a8df3c52ca5b6e3e8f88113bd

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

LOG: [VectorCombine] foldShuffleChainsToReduce - add dbg cost comparison message (#199233)

Help track whether a fold was attempted or not

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 d6a6f18c6209d..0c97016665ca3 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -4179,6 +4179,9 @@ bool VectorCombine::foldShuffleChainsToReduce(Instruction &I) {
   IntrinsicCostAttributes ICA(ReducedOp, ReduceVecTy, {ReduceVecTy});
   NewCost += TTI.getIntrinsicInstrCost(ICA, CostKind);
 
+  LLVM_DEBUG(dbgs() << "Found reduction shuffle chain: " << I << "\n OldCost : "
+                    << OrigCost << " vs NewCost: " << NewCost << "\n");
+
   if (NewCost >= OrigCost)
     return false;
 


        


More information about the llvm-commits mailing list