Skip to content

Commit 1ea556a

Browse files
author
Leon Clark
committed
Fix cost analysis after rebase.
1 parent 5aadedb commit 1ea556a

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
@@ -4056,10 +4056,12 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
40564056

40574057
// Calculate costs for worst cases and compare.
40584058
auto const Kind = TTI::SK_PermuteSingleSrc;
4059-
auto OldCost = std::max(TTI.getShuffleCost(Kind, InputVT, Mask0, CostKind),
4060-
TTI.getShuffleCost(Kind, InputVT, Mask1, CostKind));
4061-
auto NewCost = TTI.getShuffleCost(Kind, InputVT, NewMask, CostKind) +
4062-
TTI.getShuffleCost(Kind, InputVT, Mask1, CostKind);
4059+
auto OldCost =
4060+
std::max(TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask0, CostKind),
4061+
TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask1, CostKind));
4062+
auto NewCost =
4063+
TTI.getShuffleCost(Kind, InputVT, InputVT, NewMask, CostKind) +
4064+
TTI.getShuffleCost(Kind, ResultVT, InputVT, Mask1, CostKind);
40634065

40644066
if (NewCost > OldCost)
40654067
return false;

0 commit comments

Comments
 (0)