This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Improve legalization of INSERT_SUBVECTOR to avoid spilling
ClosedPublic

Authored by mkuper on May 27 2016, 6:14 PM.

Details

Summary

Instead of always spilling the vector and then performing the insert in-memory, when possible, insert directly into the correct half of the newly-split vector.

Unfortunately, aside from the SAD test, this doesn't really seem to get hit, and I'm not sure how to construct a test-case for the high lanes. One alternative is to make this safer by only inserting directly when Idx is 0 (this tested, and probably the common case). Let me know if you think that would be better.

Diff Detail

Repository
rL LLVM

Event Timeline

mkuper updated this revision to Diff 58872.May 27 2016, 6:14 PM
mkuper retitled this revision from to [DAG] Improve legalization of INSERT_SUBVECTOR to avoid spilling.
mkuper updated this object.
mkuper added reviewers: bkramer, wmi.
mkuper added a subscriber: llvm-commits.
RKSimon edited edge metadata.May 28 2016, 3:39 PM

Unfortunately, aside from the SAD test, this doesn't really seem to get hit, and I'm not sure how to construct a test-case for the high lanes. One alternative is to make this safer by only inserting directly when Idx is 0 (this tested, and probably the common case). Let me know if you think that would be better.

Only using this for ((IdxVal == 0) && (IdxVal + SubElems <= VecElems / 2)) is probably for the best (along with a suitable TODO comment). Alternatively investigate AVX512F tests that use (illegal) 64i8 / 32i6 types to try and trigger the insertion?

mkuper updated this revision to Diff 59085.May 31 2016, 10:21 AM
mkuper edited edge metadata.

Thanks, Simon!
Updated to only fire when the index is 0.

mkuper updated this revision to Diff 59087.May 31 2016, 10:30 AM

And now, with the right condition.

RKSimon accepted this revision.Jun 1 2016, 12:46 PM
RKSimon edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 1 2016, 12:46 PM
This revision was automatically updated to reflect the committed changes.