[PATCH] D71023: [x86] add cost model special-case for insert/extract from element 0

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 08:36:43 PST 2019


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon, ABataev.
Herald added subscribers: llvm-commits, hiraditya, mcrosier.
Herald added a project: LLVM.

This is a follow-up to D70607 <https://reviews.llvm.org/D70607> where we made any extract element on SLM more costly than default. But that is pessimistic for extract from element 0 because that corresponds to x86 movd/movq instructions. These generally have >1 cycle latency, but they are probably implemented as single uop instructions.

Note that no vectorization tests are affected by this change. Also, no targets besides SLM are affected because those are falling through to the default cost of 1 anyway. But this will become visible/important if we add more specializations via cost tables.


https://reviews.llvm.org/D71023

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/fptosi.ll
  llvm/test/Analysis/CostModel/X86/fptoui.ll
  llvm/test/Analysis/CostModel/X86/shuffle-extract_subvector.ll
  llvm/test/Analysis/CostModel/X86/vector-extract.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71023.232144.patch
Type: text/x-patch
Size: 28466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/25923176/attachment.bin>


More information about the llvm-commits mailing list