This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Do not generate illegal G_SEXTLOADs after legalization
ClosedPublic

Authored by kschwarz on Aug 24 2021, 6:59 AM.

Details

Summary

The sext_inreg_of_load combine did not have the isLegalOrBeforeLegalizer check,
leading to the generation of potentially illegal G_SEXTLOADs when run after legalization.

Diff Detail

Event Timeline

kschwarz created this revision.Aug 24 2021, 6:59 AM
kschwarz requested review of this revision.Aug 24 2021, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 6:59 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad accepted this revision.Aug 24 2021, 8:10 AM

Looks reasonable to me.

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
727–730

Since this code is now repeated several times in this file, I wonder if MemDesc should be constructible from an MMO, so you could write:

LegalityQuery::MemDesc MMDesc(MMO);
MMDesc.MemoryTy = /* just override the size */;
This revision is now accepted and ready to land.Aug 24 2021, 8:10 AM
This revision was landed with ongoing or failed builds.Aug 25 2021, 1:14 AM
This revision was automatically updated to reflect the committed changes.