[PATCH] D73646: [X86] Fix the cost model for v16i16->v16i32 zero_extend/sign_extend with AVX2

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 10:35:22 PST 2020


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
craig.topper added a comment.

I guess the cost should be 3 if we count the extract we need to split the 16i16 input. New patch coming in a moment.


We seem to be inheriting the cost from sse4.1. But if we have 256-bit registers we should be able to do this with just two v8i16->v8i32 operations so our cost should be 2 not 4.


https://reviews.llvm.org/D73646

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/arith-fix.ll
  llvm/test/Analysis/CostModel/X86/arith-overflow.ll
  llvm/test/Analysis/CostModel/X86/cast.ll
  llvm/test/Analysis/CostModel/X86/extend.ll
  llvm/test/Analysis/CostModel/X86/min-legal-vector-width.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73646.241215.patch
Type: text/x-patch
Size: 14002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200129/7bb494e4/attachment.bin>


More information about the llvm-commits mailing list