[llvm] 869797d - [VectorCombine] Add a debug message for foldShuffleOfCastop. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 6 23:54:29 PDT 2024


Author: David Green
Date: 2024-04-07T07:54:22+01:00
New Revision: 869797daca38941e0af3bcd8ae5300bcebf7b1a9

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

LOG: [VectorCombine] Add a debug message for foldShuffleOfCastop. NFC

This optimization, much like the existing foldShuffleOfBinops can cause a
lot of regressions. Add a quick debug message to make the costs are more
obvious.

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 3738220b4f816b..61e3f0ff55f7b2 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1485,6 +1485,10 @@ bool VectorCombine::foldShuffleOfCastops(Instruction &I) {
       TargetTransformInfo::SK_PermuteTwoSrc, CastSrcTy, Mask, CostKind);
   NewCost += TTI.getCastInstrCost(Opcode, ShuffleDstTy, NewShuffleDstTy,
                                   TTI::CastContextHint::None, CostKind);
+
+  LLVM_DEBUG(dbgs() << "Found a shuffle feeding two casts: " << I
+                    << "\n  OldCost: " << OldCost << " vs NewCost: " << NewCost
+                    << "\n");
   if (NewCost > OldCost)
     return false;
 


        


More information about the llvm-commits mailing list