[PATCH] D39845: [TableGen] Give the option of tolerating duplicate register names

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 03:31:45 PST 2017


asb added a comment.

In https://reviews.llvm.org/D39845#945646, @kparzysz wrote:

> I think that leaving the returned value unspecified is better, at least for now.  Otherwise, we'd need to invent a way to identify the "preferred" register, and then it would need to be preserved by any future modifications to the MatchRegisterName et.al. functions.


Passing a "preferred" register class (or similar) to MatchRegisterName is never really going to work I don't think, at least not without some fairly invasive changes to the asm parser to allow that information to be threaded through. Coercing a register later on is much easier. https://reviews.llvm.org/D39895 currently relies on the fact that MatchRegisterName and MathRegisterAltName prefer to return the `F*_32` registers due to them sorting before `F*_64`. It would be pretty easy to check the current behaviour in a test, thus ensuring it doesn't change. But for now, let's leave it undefined as you suggest.


https://reviews.llvm.org/D39845





More information about the llvm-commits mailing list