[llvm-commits] [RFC] ExecutionEngine API for adding custom passes

James Molloy James.Molloy at arm.com
Thu Nov 1 15:43:26 PDT 2012


Ping!
________________________________________
From: llvm-commits-bounces at cs.uiuc.edu [llvm-commits-bounces at cs.uiuc.edu] On Behalf Of James Molloy [James.Molloy at arm.com]
Sent: 31 October 2012 17:53
To: llvm-commits at cs.uiuc.edu
Subject: [llvm-commits] [RFC] ExecutionEngine API for adding custom passes

Hi,

I have a use case where I have written a MachineFunctionPass, which I
would like to have run on a Module which I will eventually pass to the
MCJIT.

Currently, the only real way I can do this is by compiling the module
twice, because MachineFunctionPasses need to be added to PassManagers
after ::addPassesToEmit* is called, and the MCJIT creates its own
PassManager and calls that locally itself.

It's really inefficient to have to go through the codegen process twice
just because I can't add a pass to what the MCJIT runs, so I've attached
a proposed addition to the ExecutionEngine interface.

This adds a suite of functions to add "compilation hooks". These would
be unimplemented on the Interpreter and old-style JIT. They are function
pointers that a user would give, that take a PassManager& argument and
allow the user to add passes manually.

Is this something that would be acceptable to have in trunk?

Cheers,

James






More information about the llvm-commits mailing list