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

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 09:31:04 PDT 2016


rnk added a comment.

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

> I would really like to see fewer predicates here. It is too hard to figure
>  out the right one.
>
> 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.


Even if it were renamed to `isStrongDefinition`? There is no difference between the notions of "strong definition" and "strong definition for linker". In both cases you're looking at the true definition of the symbol. It cannot be de-refined, assuming LLVM's optimizations always refine things.

Now it occurs to me that there are instrumentation passes like MSan that can de-refine code after optimization, and make a readnone function into a function that stores to shadow memory. I wonder if that matters.

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

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


Well, the inliner still needs mayBeOverridden or some equivalent way of separating ODR linkages from non-ODR linkages. It's the only IPO transform that everyone agrees is safe for ODR functions.


http://reviews.llvm.org/D18634





More information about the llvm-commits mailing list