[LLVMdev] Marking a function prototype as being "persistent"

Christophe de Dinechin christophe at taodyne.com
Thu Jan 6 02:43:44 PST 2011


Hello and happy new year,


I'm using LLVM to JIT-compile the XL programming language. I've recently added a whole-program optimization phase that gives excellent results, but I noticed that the StripDeadPrototypesPass was removing all references to my runtime support functions. 

Apparently, this depends on the oddly-named UnitAtATime parameter. Set it to false. Try again. Suggestion: what about a comment explaining what "UnitAtATime" means :-)

Even then, my runtime function prorotypes are still being stripped away by the GlobalDCE added by createStandardLTOPasses.

So my question is: what is the correct, officially recommended way to reference runtime functions so that global DCE won't get rid of them? Or am I supposed to re-create the corresponding Function instances for every translation?


Thank you in advance for enlightening me
Christophe





More information about the llvm-dev mailing list