[PATCH] Don't ever call materializeAllPermanently during LTO

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Oct 23 21:44:18 PDT 2014


A pet peeve I had with our lazy loading of IR is that isDeclaration
returns the wrong result. It sees a function with no body and says it
is a declaration.

This was just a pet peeve until now since very few places actually
have to handle lazy loaded IR.

The issue is that the existing representation also prevents one from
removing a function body without reading in the entire module. The
problem is that if the body is removed, it will just be read back in
afterwards since the two situations look identical.

The attached patch changes llvm to use an explicit bit in Functions to
say that they are materializable. With this change isDeclaration now
always returns the correct value and we can drop functions without
calling materializeAllPermanently.

By itself this patch has a small impact. Its main advantage is opening
the way for trying to make debug reading lazy too.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 15395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141024/d7aaff36/attachment.bin>


More information about the llvm-commits mailing list