This is an archive of the discontinued LLVM Phabricator instance.

[DAG] DAGCombiner::visitVECTOR_SHUFFLE - recognise chain of INSERT_SUBVECTOR patterns
AbandonedPublic

Authored by lebedev.ri on Aug 5 2021, 8:00 AM.

Details

Summary

A logical extension to D107068 - we don't strictly need to have
a single insertion into an otherwise-identity LHS.

While the general case of iteratively chopping off bits of a mask,
but keeping the shuffle result in obviously-bad codegen regressions,
the case where we reduce the entire shuffle into a seqnence of
subvector insertions, and drop said shuffle, seems somewhat promising.

Diff Detail

Event Timeline

lebedev.ri created this revision.Aug 5 2021, 8:00 AM
lebedev.ri requested review of this revision.Aug 5 2021, 8:00 AM
lebedev.ri edited the summary of this revision. (Show Details)
lebedev.ri planned changes to this revision.Aug 5 2021, 8:13 AM

I'm working on a concat(concat,concat) fold that should help a lot more than this (although I might not get it finished before going on holiday next week) - what could be done as an extension of D107068 is handle the case where the insert_subvector straddles multiple concat entries (i.e. slice the concat ops into a smaller concat and insert that as a subvector).

lebedev.ri updated this revision to Diff 364523.Aug 5 2021, 9:57 AM

I'm working on a concat(concat,concat) fold that should help a lot more than this (although I might not get it finished before going on holiday next week) - what could be done as an extension of D107068 is handle the case where the insert_subvector straddles multiple concat entries (i.e. slice the concat ops into a smaller concat and insert that as a subvector).

Hmm yeah, now that i have fixed the code to actually work as planned, it currently does not trigger on any of the existing tests.

lebedev.ri planned changes to this revision.Aug 5 2021, 9:58 AM
lebedev.ri abandoned this revision.Jan 17 2022, 2:35 PM