Page MenuHomePhabricator

MIR Serialization: Connect the machine function analysis pass to MIR parser.
ClosedPublic

Authored by arphaman on May 21 2015, 5:54 PM.

Details

Summary

This patch is based on the patch that print and parses machine function names (http://reviews.llvm.org/D9841).

In this patch the machine function analysis pass is connected to the MIR parser to allow the MIR parser
to initialize the machine functions with the loaded state and to enable reconstruction of machine IR.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 26298.May 21 2015, 5:54 PM
arphaman retitled this revision from to MIR Serialization: Connect the machine function analysis pass to MIR parser..
arphaman updated this object.
arphaman edited the test plan for this revision. (Show Details)
arphaman added reviewers: dexonsmith, bob.wilson, bogner.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: Unknown Object (MLST).
arphaman updated this revision to Diff 26624.May 27 2015, 11:50 AM

I rebased this patch on the reorganized initial MIR commit that landed in r238341.

The patch now creates a new interface called 'MIRMachineFunctionInitializer' under
CodeGen that is used by the MIRParser to connect to the machine function analysis
pass without making CodeGen depend on MIRParser.

arphaman updated this revision to Diff 27214.Jun 5 2015, 11:34 AM

Rebase on master.

arphaman updated this revision to Diff 27414.Jun 9 2015, 4:31 PM

I've updated the patch based on Justin's comments:

  • renamed MIRMachineFunctionInitializer to MachineFunctionInitializer
  • simplified the MIRParser library interface - now the functions only create the parser, they don't parse the LLVM module. The LLVM module can be parsed by calling the appropriate method from the MIRParser class.
  • reworked the error handling to use LLVM's diagnostic info.

I also added the 'anchor' method to the MachineFunctionInitializer interface.

arphaman updated this revision to Diff 27685.Jun 15 2015, 10:15 AM

I've updated the patch to address some of Justin's concerns:

  • parseLLVMModule now doesn't need the error parameter, the diagnostics are reported via LLVMContext.
  • Got rid of the diagnostic handler from llc, and modified LLVMContext's diagnostic printer so that it is able of printing out the mir diagnostics with colors.
  • Added an assert that an LLVM IR module is always non null after parsing it with mirparser in llc.
arphaman updated this revision to Diff 27694.Jun 15 2015, 11:21 AM

The updated patch removes the special printing behavior for MIR diagnostics from the LLVMContext.

arphaman updated this revision to Diff 27695.Jun 15 2015, 11:26 AM

updated the MIR tests so that they pass with the previous update.

This revision was automatically updated to reflect the committed changes.