aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2024-04-07 07:54:22 +0100
committerDavid Green <david.green@arm.com>2024-04-07 07:54:22 +0100
commit869797daca38941e0af3bcd8ae5300bcebf7b1a9 (patch)
treefe31e40b9e17b17f7a3893090b14f347f92ab017
parenta2c4b7c8e2740a83f141dcf06cf50359588190b9 (diff)
downloadllvm-869797daca38941e0af3bcd8ae5300bcebf7b1a9.zip
llvm-869797daca38941e0af3bcd8ae5300bcebf7b1a9.tar.gz
llvm-869797daca38941e0af3bcd8ae5300bcebf7b1a9.tar.bz2
[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.
-rw-r--r--llvm/lib/Transforms/Vectorize/VectorCombine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 3738220..61e3f0f 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;