This is an archive of the discontinued LLVM Phabricator instance.

DAG: Handle odd vector sizes in calling conv splitting
ClosedPublic

Authored by arsenm on Aug 10 2018, 10:44 AM.

Details

Summary

This already worked if only one register piece was used,
but didn't if a type was split into multiple, unequal
sized pieces.

Fixes not splitting 3i16/v3f16 into two registers for
AMDGPU.

This will also allow fixing the ABI for 16-bit vectors
in a future commit so that it's the same for all subtargets.

Diff Detail

Event Timeline

arsenm created this revision.Aug 10 2018, 10:44 AM
nhaehnle added inline comments.Aug 31 2018, 11:18 AM
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
728–731

If I understand correctly what the code is trying to do, i * IntermediateNumElts would also work, right? That would be much clearer IMHO.

Also, this definition can be moved into the if case.

RKSimon added inline comments.Sep 3 2018, 4:04 AM
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
618

Please could you pull this helper out in a NFCI patch first? Then any functional changes you've made will be much easier to spot.

arsenm updated this revision to Diff 163698.Sep 3 2018, 5:41 AM

Split out piece, change index calculation

RKSimon added inline comments.Sep 6 2018, 2:46 AM
lib/Target/AMDGPU/SIISelLowering.cpp
741–742

Update the FIXME comment?

arsenm updated this revision to Diff 164193.Sep 6 2018, 5:50 AM

Fix comment

This revision is now accepted and ready to land.Sep 10 2018, 2:20 AM
arsenm closed this revision.Sep 10 2018, 4:50 AM

r341801