[PATCH] D50833: [x86/MIR] Add full MIR support for pre- and post-instruction symbols, as well as parsing support for `MCSymbol` `MachineOperand`s.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 01:13:35 PDT 2018


chandlerc created this revision.
chandlerc added reviewers: hfinkel, rnk, bogner.
Herald added subscribers: hiraditya, mcrosier, sanjoy.

The only real way to test pre- and post-instruction symbol support is to
use them, so I ended up implementing all of this. I can split out the
operand support if folks really want but it doesn't really seem worth
it. This still isn't full support, as it forces the symbols to be
non-temporary and non-local symbols with names. However, those names
often can encode most (if not all) of the special semantics desired, and
unnamed symbols seem especially annoying to serialize and de-serialize.
While this isn't perfect or full support, it seems plenty to write tests
that exercise usage of these kinds of operands.

The support for pre-and post-instruction symbols was quite
straightforward. I chose to print them out in an as-if-operand syntax
similar to debug locations as this seemed the cleanest way and let me
use nice introducer tokens rather than inventing more magic punctuation
like we use for memoperands.

However, supporting MIR-based parsing of these symbols caused me to
change the design of the symbol support to allow setting arbitrary
symbols. Without this, I don't see any reasonable way to test things
with MIR.

The next patch will add MC support for emitting the symbols, which
should be the last component in having all of this infrastructure
working at least for x86.

Depends on revision: https://reviews.llvm.org/D50701


Repository:
  rL LLVM

https://reviews.llvm.org/D50833

Files:
  llvm/docs/MIRLangRef.rst
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/lib/CodeGen/MIRParser/MILexer.cpp
  llvm/lib/CodeGen/MIRParser/MILexer.h
  llvm/lib/CodeGen/MIRParser/MIParser.cpp
  llvm/lib/CodeGen/MIRPrinter.cpp
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/test/CodeGen/MIR/X86/instr-symbols-and-mcsymbol-operands.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50833.160974.patch
Type: text/x-patch
Size: 19680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180816/90560a06/attachment.bin>


More information about the llvm-commits mailing list