This is an archive of the discontinued LLVM Phabricator instance.

[X86] Attempt to more accurately model the cost of a bool reduction of wide vector type.
ClosedPublic

Authored by craig.topper on Mar 18 2020, 6:20 PM.

Details

Summary

Previously we multiplied the cost for the table entries by the number of splits needed. But that implies that each split goes through a reduction to scalar independently. I think what really happens is that the we AND/OR the split pieces until we're down to a single value with a legal type and then do special reduction sequence on that.

So to model that this patch takes the number of splits minus one multiplied by the cost of a AND/OR at the legal element count and adds that on top of the table lookup.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 18 2020, 6:20 PM
RKSimon accepted this revision.Mar 19 2020, 5:53 AM

LGTM

llvm/lib/Target/X86/X86TargetTransformInfo.cpp
2782–2783

We might be able to drop this FIXME now.

This revision is now accepted and ready to land.Mar 19 2020, 5:53 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2020, 9:48 AM