This is an archive of the discontinued LLVM Phabricator instance.

[x86] add and use fast horizontal vector math subtarget feature
ClosedPublic

Authored by spatel on Oct 10 2018, 10:27 AM.

Details

Summary

This is the planned follow-up to D52997. Here we are reducing horizontal vector math codegen by default. AMD Jaguar (btver2) should have no difference with this patch because it has fast-hops. (If we want to set that bit for other CPUs, let me know.)

The code changes are small, but there are many test diffs. For files that are specifically testing for hops, I added RUNs to distinguish fast/slow, so we can see the consequences side-by-side. For files that are primarily concerned with codegen other than hops, I just updated the CHECK lines to reflect the new default codegen.

To recap the recent horizontal op story:

  1. Before rL343727, we were producing hops for all subtargets for a variety of patterns. Hops were likely not optimal for all targets though.
  2. The IR improvement in r343727 exposed a hole in the backend hop pattern matching, so we reduced hop codegen for all subtargets. That was bad for Jaguar (PR39195).
  3. We restored the hop codegen for all targets with rL344141. Good for Jaguar, but probably bad for other CPUs.
  4. This patch allows us to distinguish when we want to produce hops, so everyone can be happy. I'm not sure if we have the best predicate here, but the intent is to undo the extra hop-iness that was enabled by r344141.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Oct 10 2018, 10:27 AM
andreadb accepted this revision.Oct 11 2018, 8:53 AM

LGTM.

Thanks Sanjay!

This revision is now accepted and ready to land.Oct 11 2018, 8:53 AM
RKSimon accepted this revision.Oct 11 2018, 8:55 AM

LGTM too

This revision was automatically updated to reflect the committed changes.