[PATCH] D18634: Don't IPO over functions that can be de-refined

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 19:02:33 PDT 2016


sanjoy added a comment.

In http://reviews.llvm.org/D18634#387841, @chandlerc wrote:

>




> isStrongDefinitionForLinker doesn't make a lot of sense to me as the

>  spelling of the predicate though because it doesn't tell me, the

>  optimization author, what it means.


If we want to common `isStrongDefinitionForLinker` and
`mayBeDerefined`, we'll be stuck with using it both in the linker and
in IR level transforms; so we'd need a name that makes sense for both
contexts.

> Note that I think mayBeOverridden will become irrelevant with this change,

>  and so I would look closely at removing that or re-using it.


We will still need a predicate that says "this function can be
replaced with an arbitrary other function at link time[1]" (i.e. can
be interposed); since in that case we have to prevent inlining as
well.

[1]: in mayBeDerefined, the invariant is that what the optimizer sees is
always *a* correct implementation of the source function.


http://reviews.llvm.org/D18634





More information about the llvm-commits mailing list