[PATCH] TableGen: Generate an enum for all named Operand types

Sean Silva silvas at purdue.edu
Tue Nov 12 18:22:41 PST 2013

On Tue, Nov 12, 2013 at 12:59 PM, Quentin Colombet <qcolombet at apple.com>wrote:

> Hi Ahmed,
> The code looks fine to me, but the additional documentation is a bit too
> short.

Indeed. This needs examples of the code that is generated in the .inc files
and the corresponding TableGen constructs which cause this to be generated
(I'm trying to make that the new "minimum bar" documentation-wise for all
features which add new stuff to TableGen's output). If necessary, don't be
afraid to add a whole new page like <
http://llvm.org/docs/HowToUseInstrMappings.html> did.

-- Sean Silva

> +TableGen will also generate an enumeration consisting of all named Operand
> +types defined in the backend, in the llvm::XXX::OpTypes namespace.
> +
> Indeed, I am not sure that it is clear that "types defined in the backend"
> are the derived types in the backend. In my opinion the proposed phrasing
> would suffix if and only if there is an example to illustrate it.
> Unfortunately, you cannot reuse the XNORrr example as it does not have
> such types. You have to add one.
> Out of curiosity, for your mapping how the “regular” types are mapped?
> Cheers,
> -Quentin
> On Nov 11, 2013, at 1:42 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com>
> wrote:
> Hi Quentin, all,
> Here's the next patch I had waiting for review.
> In some situations it's very useful to have access to an enum of all
> operand types (that is, instances of Operand in the target's tablegen
> files).
> My use for this is associating MI/SD-pattern level operands with the
> underlying list of MC operand, and keeping track of that association.
> I also sent a nice-to-have feature implemented in another email
> (complete machine operand printing) that was very helpful for
> debugging and testing.
> Thanks!
> - Ahmed
> ---
> docs/WritingAnLLVMBackend.rst       |  3 +++
> utils/TableGen/InstrInfoEmitter.cpp | 31 +++++++++++++++++++++++++++++++
> 2 files changed, 34 insertions(+)
> <0001-TableGen-Generate-an-enum-for-all-named-Operand-type.patch>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/e7421390/attachment.html>

More information about the llvm-commits mailing list