Skip to content

Commit 7f0481c

Browse files
author
Leon Clark
committed
Fix cost analysis after rebase.
1 parent 6c133f5 commit 7f0481c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,10 +3753,12 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
37533753

37543754
// Calculate costs for worst cases and compare.
37553755
auto const Kind = TTI::SK_PermuteSingleSrc;
3756-
auto OldCost = std::max(TTI.getShuffleCost(Kind, InputVT, Mask0, CostKind),
3757-
TTI.getShuffleCost(Kind, InputVT, Mask1, CostKind));
3758-
auto NewCost = TTI.getShuffleCost(Kind, InputVT, NewMask, CostKind) +
3759-
TTI.getShuffleCost(Kind, InputVT, Mask1, CostKind);
3756+
auto OldCost =
3757+
std::max(TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask0, CostKind),
3758+
TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask1, CostKind));
3759+
auto NewCost =
3760+
TTI.getShuffleCost(Kind, InputVT, InputVT, NewMask, CostKind) +
3761+
TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask1, CostKind);
37603762

37613763
if (NewCost > OldCost)
37623764
return false;

0 commit comments

Comments
 (0)