This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][GlobalISel] Allow duplicate RendererFns
ClosedPublic

Authored by foad on Feb 12 2021, 2:23 AM.

Details

Summary

Allow different GICustomOperandRenderers to use the same RendererFn.
This avoids the need for targets to define a bunch of identical C++
renderer functions with different names.

Without this fix TableGen would have emitted code that tried to define
the GICR enumeration with duplicate enumerators.

Diff Detail

Event Timeline

foad created this revision.Feb 12 2021, 2:23 AM
foad requested review of this revision.Feb 12 2021, 2:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2021, 2:23 AM
arsenm added inline comments.Feb 12 2021, 6:42 AM
llvm/utils/TableGen/GlobalISelEmitter.cpp
5604

Could use a comment

foad updated this revision to Diff 323317.Feb 12 2021, 6:54 AM

Add a comment. Switch from stable_sort to llvm::sort because it doesn't need to be stable and for consistency with surrounding code.

arsenm accepted this revision.Feb 12 2021, 6:55 AM
This revision is now accepted and ready to land.Feb 12 2021, 6:55 AM
This revision was landed with ongoing or failed builds.Feb 12 2021, 7:05 AM
This revision was automatically updated to reflect the committed changes.