[LLVMdev] Constraints of MachineFunctionPasses

Czurda Christoph Christoph.Czurda.fl at ait.ac.at
Tue Jun 9 05:59:35 PDT 2015


Hello,

I'm having troubles understanding the requirements for machine function passes: http://llvm.org/releases/3.4/docs/WritingAnLLVMPass.html#the-machinefunctionpass-class
It says that they are not allowed to "Maintain state across invocations of runOnMachineFunction (including global data)."

However, doesn't for example the LiveVariables Pass do exactly that? Besides, how should an analysis pass be of any use if it's not allowed to build up data structures that persist after the pass has been run?

What I actually want to do is to remember for each function call, which physical registers are live at the time of the call. Therefore I want to fill a map that contains functions as keys and lists of registers as values. Wouldn't a machine function pass be the natural solution to this?

Best regards,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150609/ad4a2cfa/attachment.html>


More information about the llvm-dev mailing list