[LLVMdev] Available code-generation parallism

Jonathan Brandmeyer jbrandmeyer at earthlink.net
Sun Nov 2 14:20:41 PST 2008


I am interested in making my LLVM front-end multi-threaded in a way
similar to the GCC compiler server proposal and was wondering about the
extent that the LLVM passes support it.

Expression-at-a-time parallel construction:
If function definitions are built purely depth-first, such that the
parent pointers are not provided as they are created, what will break?
I noted that the function and module verifiers aren't complaining, at
least not yet.  Is there a generic "fixup upward-pointing parent
pointers" pass that can be run afterwords?  If not, do I need to
implement and perform that pass?  I suspect that emitting code for
individual expressions in parallel will probably end up being too
fine-grained, which leads me to...

Function-at-a-time parallel construction:
Which (if any) LLVM objects support the object-level thread safety
guarantee?  If I construct two separate function pass managers in
separate threads and use them to optimize and emit object code for
separate llvm::Function definitions in the program, will this work?
Same question for llvm::Modules.

Thanks,
-Jonathan Brandmeyer




More information about the llvm-dev mailing list