This is an archive of the discontinued LLVM Phabricator instance.

[X86][TLI] SimplifyDemandedVectorEltsForTargetNode(): don't break apart broadcasts from which not just the 0'th elt is demanded
ClosedPublic

Authored by lebedev.ri on Aug 19 2021, 2:15 PM.

Details

Summary

Apparently this has no test coverage before D108382,
but D108382 itself shows a few regressions that this fixes.

It doesn't seem worthwhile breaking apart broadcasts,
assuming we want the broadcasted value to be preset in several elements,
not just the 0'th one.

Diff Detail

Event Timeline

lebedev.ri created this revision.Aug 19 2021, 2:15 PM
This revision is now accepted and ready to land.Aug 21 2021, 10:02 AM

LGTM

Thank you for the review!

Something that I've been wondering about is whether SelectionDAG::isSplatValue should be moved to TLI to make it possible to peek through target opcodes as well to help identify more splats/broadcasts - have you noticed anything that might benefit?

Note that this does not appear to have test coverage before it's parent patch.

Something that I've been wondering about is whether SelectionDAG::isSplatValue should be moved to TLI to make it possible to peek through target opcodes as well to help identify more splats/broadcasts

That does sound plausible.

  • have you noticed anything that might benefit?

I don't really know, but the change doesn't seem too intrusive so i suppose i could just try doing that and seeing the fallout.

Rebased, NFC.

RKSimon accepted this revision.Aug 23 2021, 6:35 AM

LGTM

lebedev.ri updated this revision to Diff 370081.Sep 1 2021, 3:06 PM

Rebased, NFC. Stop stamping, i get it.

Rebased, NFC.
Going to land this now.

This revision was landed with ongoing or failed builds.Sep 19 2021, 7:39 AM
This revision was automatically updated to reflect the committed changes.