This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Use the non-pointer LLT equivalent to check regclass type
Needs RevisionPublic

Authored by lewis-revill on Feb 2 2022, 2:39 AM.

Details

Reviewers
dsanders
arsenm
Summary

When we check the type legality of assigning a given LLT to a register class, we compare the LLT equivalents of the MVTs assigned to the register class to the given LLT. However since no MVTs match to the pointer LLTs, we always return false when given a pointer LLT - even if the type size and shape is legal for the register class.

This patch simply uses the non-pointer LLT equivalent to compare against the LLT equivalents of the MVTs assigned to the register class instead. Thus we can report pointer types as legal for register classes when their size and shape is legal.

Diff Detail

Event Timeline

lewis-revill created this revision.Feb 2 2022, 2:39 AM
lewis-revill requested review of this revision.Feb 2 2022, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 2:39 AM

Bump - is anyone able to review this?

arsenm added a comment.Feb 9 2022, 8:36 AM

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Sorry not quite sure what exactly a verifier test refers to. Do you mean an LLC test for the issue in RISC-V that exposed this or something else?

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Sorry not quite sure what exactly a verifier test refers to. Do you mean an LLC test for the issue in RISC-V that exposed this or something else?

Yes. You can write a test that fails the verifier and check the verifier output is consistent here. e.g. I added such a test in cea97fc0fcd86d52f9efa215116356b72faeb17d when I added this version

arsenm requested changes to this revision.Dec 14 2022, 6:02 AM

Should get a verifier test

This revision now requires changes to proceed.Dec 14 2022, 6:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 6:02 AM