[llvm-commits] MachineInstr serializer and parser

Bin Zeng bzeng at apple.com
Thu May 31 21:27:40 PDT 2012


Hi all,

Thanks for the reviews. I am working on a serializer and parser for MachineInstr's in the backend.
The opt driver has a very nice feature that you can serialize IR after a specific pass and, if you
want, deserialize it and get an identical copy of the original code before serialization and resume
compilation there.  The project I am working on tries to bring that nice feature to the backend so that
the MachineInstr's can be serialized after a specific pass and deserialized later and continue codegen
there if you want. Since its goal is to help debug passes,  the format will be in human readable yaml 
format instead of a binary format.

This patch contains the skeleton of the serializer pass and the parser pass: MachineInstrSerializerPass
and MachineInstrParserPass and their command line options: -serialize-mi=pass-arg and
-parse-mi=pass-arg where pass-arg is the argument of the pass after which the MachineInstr's will
be serialized and parsed respectively. If you have better ideas for their names, please do not hold them
to yourself. Also, these two passes are MachineFunctionPass's. They can only serialize a MachineFunction at a
time so far. To get a snapshot of the whole module after a specific pass, I need to visit the other MachineFunction's.
The backend generates code for each MachineFunction at a time. I would appreciate it if you can point
me to the right direction.

Here is the patch. Thanks for reading.
-Bin
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serialize-parse-mi-0.3.diff
Type: application/octet-stream
Size: 11449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120531/539af78c/attachment.obj>
-------------- next part --------------




More information about the llvm-commits mailing list