This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Fix SubRegIndex size computation for concatenated subregs of unknown size
ClosedPublic

Authored by bjope on Nov 18 2022, 4:19 PM.

Details

Summary

When calculating the size of concatenated subregisters, and at least
one of the subregisters involved has an unknown size (-1), then the
concatenated size should be set to -1 as well.

This bug was found for an out-of-tree target.

Looking at lib/Target the only in-tree target that has a subregister
with unknown size is X86:

X86RegisterInfo.td:  def sub_mask_0   : SubRegIndex<-1>;

But it looks like sub_mask_0 don't result in any concatenated subreg
index with faulty size if looking at X86SubRegIdxRanges[].

Diff Detail

Event Timeline

bjope created this revision.Nov 18 2022, 4:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2022, 4:19 PM
bjope requested review of this revision.Nov 18 2022, 4:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2022, 4:19 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Nov 18 2022, 4:20 PM

LGTM

This revision is now accepted and ready to land.Nov 18 2022, 4:20 PM
This revision was landed with ongoing or failed builds.Nov 20 2022, 11:52 AM
This revision was automatically updated to reflect the committed changes.