This is an archive of the discontinued LLVM Phabricator instance.

[VE] Expand single-element BUILD_VECTOR to INSERT_VECTOR_ELT
ClosedPublic

Authored by simoll on Dec 23 2020, 5:14 AM.

Details

Summary

We do this mostly to be able to test the insert_vector_elt isel patterns. As long as we don't, most single element insertions show up as BUILD_VECTOR in the backend.

Diff Detail

Event Timeline

simoll created this revision.Dec 23 2020, 5:14 AM
simoll requested review of this revision.Dec 23 2020, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2020, 5:14 AM
simoll updated this revision to Diff 314374.Jan 4 2021, 6:23 AM
  • NFC. Rebased.
kaz7 added inline comments.Jan 5 2021, 5:57 AM
llvm/test/CodeGen/VE/Vector/expand_single_elem_build_vec.ll
3

|& works only with bash. For example, this test won't work on MacOS. Please use 2>&1 | style.

On the other hand, D93687 has been merged. So I guess this it is posisble to implement this test much simply using LSV instructions.

simoll added inline comments.Jan 5 2021, 6:09 AM
llvm/test/CodeGen/VE/Vector/expand_single_elem_build_vec.ll
3

It's a chicken-egg problem.. i doubt anybody will build LLVM with VE on a MacOS system.. will fix this regardless, rebase the insert/extract element patch and update this test in a followup patch

simoll updated this revision to Diff 314596.Jan 5 2021, 7:04 AM

|& -> 2>&1 |

simoll updated this revision to Diff 315312.Jan 8 2021, 1:31 AM
simoll edited the summary of this revision. (Show Details)

This now depends on D93687 - the build_vector lowering causes introduces more instances of insert_vector_elt.

kaz7 accepted this revision.Jan 8 2021, 2:33 AM

LGTM

This revision is now accepted and ready to land.Jan 8 2021, 2:33 AM
This revision was landed with ongoing or failed builds.Jan 8 2021, 2:48 AM
This revision was automatically updated to reflect the committed changes.