[PATCH] D55452: [CostModel][X86] Teach getArithmeticReductionCost to properly cost the shuffles needed for a PairWise reduction before we reach a legal type. And remove one shuffle from the end of the reduction.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 12:35:49 PST 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.

The loop for handling illegal types queried for extract_subvector shuffle which I think will always return 0 for an illegal type on X86. But that's not the correct shuffle. We really need 2 two source permutes to extract even and odd elements. For non-pairwise we don't need any shuffle so I've removed it entirely.

We were also counting 2 shuffles on the very last reduction step when we need to add element 1 to element 0. But element 0 is already in place. So we only need to move element 1.


https://reviews.llvm.org/D55452

Files:
  include/llvm/CodeGen/BasicTTIImpl.h
  test/Analysis/CostModel/X86/reduction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55452.177280.patch
Type: text/x-patch
Size: 28780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/179d6524/attachment.bin>


More information about the llvm-commits mailing list