This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Manually select G_BUILD_VECTOR_TRUNC
ClosedPublic

Authored by arsenm on Feb 17 2020, 6:26 AM.

Details

Summary

We have patterns for s_pack* selection, but they assume the inputs are
a build_vector with 16-bit inputs, not a truncating build
vector. Since there's still outstanding work for how to handle
mismatched result and source element vector operations, and since I'm
trying a different packed vector strategy than SelectionDAG, just
manually select this for now.

Diff Detail

Event Timeline

arsenm created this revision.Feb 17 2020, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2020, 6:26 AM
kerbowa added inline comments.Feb 18 2020, 1:56 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
641

Is there a test with multiple uses of the shift?

llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-build-vector-trunc.v2s16.mir
225–226

Extra newlines

arsenm updated this revision to Diff 245657.Feb 20 2020, 7:52 AM

More tests

This revision is now accepted and ready to land.Feb 21 2020, 12:09 AM