@@ -794,17 +794,21 @@ bool VectorCombine::foldBitcastShuffle(Instruction &I) {
794
794
IsUnary ? TargetTransformInfo::SK_PermuteSingleSrc
795
795
: TargetTransformInfo::SK_PermuteTwoSrc;
796
796
797
- InstructionCost DestCost =
797
+ InstructionCost NewCost =
798
798
TTI.getShuffleCost (SK, NewShuffleTy, NewMask, CostKind) +
799
799
(NumOps * TTI.getCastInstrCost (Instruction::BitCast, NewShuffleTy, SrcTy,
800
800
TargetTransformInfo::CastContextHint::None,
801
801
CostKind));
802
- InstructionCost SrcCost =
802
+ InstructionCost OldCost =
803
803
TTI.getShuffleCost (SK, SrcTy, Mask, CostKind) +
804
804
TTI.getCastInstrCost (Instruction::BitCast, DestTy, OldShuffleTy,
805
805
TargetTransformInfo::CastContextHint::None,
806
806
CostKind);
807
- if (DestCost > SrcCost || !DestCost.isValid ())
807
+
808
+ LLVM_DEBUG (dbgs () << " Found a bitcasted shuffle: " << I << " \n OldCost: "
809
+ << OldCost << " vs NewCost: " << NewCost << " \n " );
810
+
811
+ if (NewCost > OldCost || !NewCost.isValid ())
808
812
return false ;
809
813
810
814
// bitcast (shuf V0, V1, MaskC) --> shuf (bitcast V0), (bitcast V1), MaskC'
0 commit comments