This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by spatel on Dec 4 2019, 8:34 AM.

Details

Summary

This is a follow-up to 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.

Diff Detail

Event Timeline

spatel created this revision.Dec 4 2019, 8:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2019, 8:34 AM
craig.topper accepted this revision.Dec 5 2019, 3:51 PM

Seems reasonable. LGTM

This revision is now accepted and ready to land.Dec 5 2019, 3:51 PM
This revision was automatically updated to reflect the committed changes.