[PATCH] D54984: [X86] Make X86TTIImpl::getCastInstrCost properly handle the case where AVX512 is enabled, but 512-bit vectors aren't legal.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 16:42:43 PST 2018


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

Unlike most cost model functions this code makes a lot of table lookups without using the results from getTypeLegalizationCost. This means 512-bit vectors can be looked up even when the type isn't legal.

This patch adds a check around the two tables that contain 512-bit types to make sure that neither of the types would be split by type legalization. Meaning 512 bit types are illegal. I wanted to write this in a somewhat generic way that uses type legalization query hooks. But if prefered, I can switch to just using is512BitVector and the subtarget feature.


https://reviews.llvm.org/D54984

Files:
  lib/Target/X86/X86TargetTransformInfo.cpp
  test/Analysis/CostModel/X86/min-legal-vector-width.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54984.175601.patch
Type: text/x-patch
Size: 8781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181128/2897fc9c/attachment.bin>


More information about the llvm-commits mailing list