This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Select v2s32->v2s16 G_TRUNC
ClosedPublic

Authored by arsenm on Feb 16 2020, 4:56 PM.

Details

Summary

It would be nice if there was a way to avoid the tied operand, but as far as I can tell there isn't a way to use or with op_sel to achieve this

Diff Detail

Event Timeline

arsenm created this revision.Feb 16 2020, 4:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2020, 4:56 PM
arsenm edited the summary of this revision. (Show Details)Feb 16 2020, 5:00 PM
foad accepted this revision.Feb 17 2020, 1:57 AM

LGTM.

llvm/test/CodeGen/AMDGPU/GlobalISel/trunc.ll
95

Could also do this with a single v_perm instruction, but I don't know if there's any reason to prefer it (e.g. are there any processors that have v_perm but don't have sdwa?).

This revision is now accepted and ready to land.Feb 17 2020, 1:57 AM
arsenm marked an inline comment as done.Feb 17 2020, 5:43 AM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/GlobalISel/trunc.ll
95

That would require materializing the constant in a register, so it would be 2 instructions, and 16 bytes, vs 1 8 byte instruction