[LLVMdev] Enumerating machine functions

Duncan Sands baldrick at free.fr
Sat Apr 2 00:19:38 PDT 2011

Hi Lorenzo,

> I have a doubt about running passes on machine code. We are
> implementing a transformation on machine code that consists in
> analyzing a series of functions, extracting some aggregate properties,
> and then using the extracted information to optimize each functions.
> I am not familiar with LLVM internals, so I am not sure how to
> implement each step. From the documentation, it seems that the only
> way to work on the machine-dependent representation is to write a
> MachineFunctionPass. However, such pass would be run separately on
> every function, while what we need is pretty much a ModulePass running
> on machine code, or some way to enumerate all the MachineFunction
> objects. Is there any way to achieve this?

one of the design goals of LLVM codegen is to be able to codegen one function
at a time, so the front-end can generate a function, codegen it, then throw
away the function before moving onto the next function.

Ciao, Duncan.

More information about the llvm-dev mailing list