[LLVMdev] Function-at-a-time Processing

David A. Greene dag at cray.com
Wed Jul 28 14:36:20 PDT 2010

John Criswell <criswell at illinois.edu> writes:

> Dear David,
> Dumb question: Would it be easier to write an LLVM tool that took the 
> large IR file and divided it into several smaller IR files that could 
> then be code-generated separately?

Not a dumb question.  The problem is that we can't actually create the
entire LLVM IR to dump it to a file.  It's too big.  Instead, what we
did with 2.5 was create the module-level data (globals, etc.)  and then
handled each function separately: translate to LLVM IR, optimize, print
asm and delete.  We never had LLVM IR for the entire translation unit at
any time so we could not create an LLVM IR file if we wanted to.  I did
hack in a special mode to hold all the LLVM IR so we could dump it out.
But this was for debugging purposes and wouldn't work with some customer
codes which are very large.


More information about the llvm-dev mailing list