[PATCH] D79148: [X86][CostModel] Bump the cost of vpermw/vpermt2b/vperm2w

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 16:46:21 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
craig.topper marked an inline comment as done.
craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:1092
-      {TTI::SK_PermuteSingleSrc, MVT::v16i16, 1}, // vpermw
-      {TTI::SK_PermuteSingleSrc, MVT::v8i16, 1},  // vpermw
       {TTI::SK_PermuteSingleSrc, MVT::v64i8, 8},  // extend to v32i16
----------------
We would just use pshufb for v8i16.


vpermw is 2 uops. vpermt2b/vpermt2w are two shuffle uops and a port 015 uop. Weirdly vpermb is a single uop.

This patch bumps the cost to 2 for these operations. Maybe should go to 3 for the vpermt2*, but I've started conservative.

I've also removed a few entries that were now the same as earlier subtargets or that I didn't think we really did. Like I don't think we extend v32i8 to v32i16, shuffle, and then truncate.


https://reviews.llvm.org/D79148

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/shuffle-insert_subvector.ll
  llvm/test/Analysis/CostModel/X86/shuffle-reverse.ll
  llvm/test/Analysis/CostModel/X86/shuffle-single-src.ll
  llvm/test/Analysis/CostModel/X86/shuffle-transpose.ll
  llvm/test/Analysis/CostModel/X86/shuffle-two-src.ll
  llvm/test/Analysis/CostModel/X86/strided-load-i16.ll
  llvm/test/Analysis/CostModel/X86/strided-load-i8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79148.261091.patch
Type: text/x-patch
Size: 80481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200429/41c35049/attachment.bin>


More information about the llvm-commits mailing list