This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] Update legalization condition for G_BITCAST
Needs RevisionPublic

Authored by matejam on May 22 2023, 9:14 AM.



Legalize G_BITCAST only if both types have a corresponding RegClass.

Authored by: Petar Avramovic

Diff Detail

Event Timeline

matejam created this revision.May 22 2023, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 9:14 AM
matejam requested review of this revision.May 22 2023, 9:14 AM
arsenm added inline comments.May 22 2023, 9:41 AM

You're essentially recreating a less refined version of isRegisterType, but we need the refinements. We can't purely decide this based on the raw bit sizes like this class check does, since we don't want to see something like <64 x i1> as legal. You should either filter out the cases without a corresponding class in isRegisterType or just finally round out the set of classes to cover every possible tuple

arsenm requested changes to this revision.Aug 17 2023, 3:06 PM
This revision now requires changes to proceed.Aug 17 2023, 3:06 PM