This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalIsel] Fix unable to legalize G_CONCAT_VECTORS when loading a vector.
Needs RevisionPublic

Authored by matejam on Jul 23 2021, 8:24 AM.

Details

Summary

Avoid building illegal G_CONCAT_VECTORS or G_BUILD_VECTOR instructions.
This happens when G_CONCAT_VECTORS or G_BUILD_VECTOR instructions aren't legal with the LCM (Least Common Multiple) type and
GCD (Greatest Common Divisor) type as their types.

Diff Detail

Event Timeline

matejam created this revision.Jul 23 2021, 8:24 AM
matejam requested review of this revision.Jul 23 2021, 8:24 AM
arsenm added inline comments.Jul 27 2021, 12:36 PM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
230

In general I don't think legalization action implementations should be concerned with the legality of what they are producing (beyond heuristics to choose a more optimal lowering). i.e. this patch should not solve a legalization failure

arsenm requested changes to this revision.Dec 7 2022, 10:23 AM
This revision now requires changes to proceed.Dec 7 2022, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 10:23 AM
Herald added a subscriber: kosarev. · View Herald Transcript