[TableGen][GlobalISel] Allow duplicate RendererFns
authorJay Foad <jay.foad@amd.com>
Thu, 27 Aug 2020 15:15:33 +0000 (16:15 +0100)
committerJay Foad <jay.foad@amd.com>
Fri, 12 Feb 2021 15:05:32 +0000 (15:05 +0000)
commit7e9ceed9a2e1c040de5216a56d0aec55a9b93680
treedd85d6179d4e18a5199c6dd5797e41a14454193b
parentcea9f054327be2eb83093f0202a7814b904f1076
[TableGen][GlobalISel] Allow duplicate RendererFns

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.

Differential Revision: https://reviews.llvm.org/D96587
llvm/lib/Target/AMDGPU/AMDGPUGISel.td
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
llvm/test/TableGen/GlobalISelEmitter.td
llvm/utils/TableGen/GlobalISelEmitter.cpp