This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Nov 27 2018, 4:42 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Nov 27 2018, 4:42 PM
spatel accepted this revision.Nov 28 2018, 6:55 AM

LGTM

lib/Target/X86/X86TargetTransformInfo.cpp
1555 ↗(On Diff #175601)

Remove "Support"?

1562–1563 ↗(On Diff #175601)

can squeeze these onto 1 line now...yay, 80-cols!

This revision is now accepted and ready to land.Nov 28 2018, 6:55 AM
This revision was automatically updated to reflect the committed changes.