This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] LegalizerHelper: Implement fewerElementsVector for G_LOAD/G_STORE
ClosedPublic

Authored by volkan on Oct 25 2018, 1:41 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

volkan created this revision.Oct 25 2018, 1:41 PM
volkan updated this revision to Diff 172207.Nov 1 2018, 12:47 PM

Rebased.

dsanders accepted this revision.Dec 13 2018, 4:20 AM

LGTM. The only comment I have is an observation that odd-length vectors generally don't fit well into fewerElements at the moment but that's not for this patch

lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1115 ↗(On Diff #172207)

We don't need to deal with it for this patch but: It occurs to me that extractParts can never change an odd-length vector into an even-length one. The effect of this is that most odd-length vectors can only unmerge into scalars (there's a few exceptions like 9 into 3 but only a few within the normal range of vector lengths) yet it would be more efficient to fewerElements a 5-element vector into a 4-element and a 1-element vector so that we can still use vectors for the majority of it.

This revision is now accepted and ready to land.Dec 13 2018, 4:20 AM
volkan updated this revision to Diff 178279.Dec 14 2018, 2:05 PM
  • Replaced buildMerge with buildBuildVector/buildConcatVectors.
  • Updated the test to avoid generating G_CONCAT_VECTORS as it's not legal for v4s32/v2s64.
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp