[PATCH] D74306: [MIR][ARM] WIP: Print condition code names instead of magic constants

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 08:06:54 PST 2020


efriedma added a comment.

I think something like this is nice to have: various instructions use immediates with weird encodings that make perfect sense in the code, but are sort of hard to read.

I don't really like the way this is implemented; it's adding a bunch of target-specific logic to target-independent code.

I wonder if, instead of replacing the immediate with a keyword, it would make sense to add some generic mechanism to print a comments after an operand, to sort of explain it.  We could print the condition for a condition code, but we could also decode various other kinds of encoded immediates: for example, "26" is "lsl #3" in ADDrsi.  Printing it as a comment would be simpler to implement because the parsing change would be much smaller: we continue just parsing an integer, and ignore the comment, instead of adding target-specific parsing rules.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74306/new/

https://reviews.llvm.org/D74306





More information about the llvm-commits mailing list