[cfe-dev] always_inline and noinline attributes

Matthijs Kooijman matthijs at stdin.nl
Tue Jul 22 00:08:36 PDT 2008


> I'd strongly prefer to do this in the LLVM IR level instead of on clang 
> ASTs.
That was the plan, AFAIU. Yet it would make sense to have clang do it at the
end of its compilation (by running an inliner over the generated IR).

> No, it should only happen within a translation unit.  The semantics of the 
> program should not change based on whether you're using LTO or not, and 
> inlining can sometimes change semantics for (arguably very broken) uses.
Woah, you're saying to only do inlining withing a translation unit? Does this
mean that inlining does not happen at all in LTO? I would say that inlining is
one of the more obvious uses for LTO and IMHO it would be a waste not to do it
because it would change broken programs. Could you perhaps give an example of
a use that would be semantically changed by inlining?

At the very least, I would make it an option whether to strip the
always_inline info after compiling a single translation unit, so people can
explicitely choose to still do (forced) inlining at link time.

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080722/9e1d3e9a/attachment.sig>


More information about the cfe-dev mailing list