[LLVMdev] Byte code libraries and linking

Pertti Kellomäki pk at cs.tut.fi
Wed Nov 15 04:32:39 PST 2006


To follow up on my own post:

> The only concern here is that this brings in all of libc, but I
> suppose it should be easy enough to run dead code elimination on
> linked.bc to shake out the unused bits?

Cursory browsing of LLVM optimization passes did not turn up
anything directly applicable, at least "opt -adce" and "opt -globaldce"
did not reduce the size of the byte code file much.

What I am looking for is a transformation that would take a
starting point in a byte code file (e.g. %main()), determine
the transitive closure of the functions and globals that can be reached
from there, and drop everything else. In the Lisp world it would
be called a tree shaker, I don't know how you guys would call it.

If such a pass does not exist, it would seem like a perfect candidate
for playing around with pass writing, so I would be happy to
implement it if need be.
-- 
Pertti




More information about the llvm-dev mailing list