[llvm-commits] PATCH: Tablegen - Add HWEncoding field to Register class and generate getHWEncoding() function

Tim Northover t.p.northover at gmail.com
Fri May 4 14:09:24 PDT 2012


> The attached patch causes tablegen with the -gen-register-info flag to
> generate a getHWEncoding function that returns the encoding for the given
> register.  This is useful for targets like R600 that have hundreds of
> registers, which makes it very tedious to write a function like this by
> hand.

Don't suppose I could convince you to do the reverse mapping too? Or
does R600 not need that? Obviously it would be with respect to a given
register class, but I've always considered "bitwise-encoding+RegClass
-> LLVM register" the uglier set of functions.

Other than that, I'm not really a reviewer I'm afraid so just consider
this biekshedding if you want, but for what it's worth:
  * I do like the name "HWEncoding" over the recently removed "Num" field.
  * Tests or documentation would be good. Particularly as R600 isn't
in tree yet, I can't see how anyone would find out about this nice
feature without it.

Tim.




More information about the llvm-commits mailing list