This is an archive of the discontinued LLVM Phabricator instance.

Use caller information to avoid noalias metadata
Needs ReviewPublic

Authored by jdoerfert on Apr 2 2017, 9:13 AM.

Details

Summary

Before introducing noalias metadata after inlining we check if we need
it or if it is already implied in the caller. That is the case if
the parameter is an argument of the caller that has a noalias attribute
and is otherwise not used in the call. For the former we only look
through pointer casts for now, for the latter we assume all instructions
to be potentially influenced by the caller argument in question.

Event Timeline

jdoerfert created this revision.Apr 2 2017, 9:13 AM
dberlin edited edge metadata.Apr 2 2017, 10:23 AM

It's early in the morning, but I'm having a little trouble understanding the overall goal. Is this fixing a bug, it just being done because it's a waste of time to add the metadata in this situation.

It's early in the morning, but I'm having a little trouble understanding the overall goal. Is this fixing a bug, it just being done because it's a waste of time to add the metadata in this situation.

The latter. There is no correctness bug, just to much metadata in certain situations. The initial idea was to improve the situation of the XLA folks that have to limit the amount of alias information they generate due to the compile time impact.
While David informed me this might not help their case at all, it should avoid the generation of metadata in some cases and could be extended to handle more.

At the end of the day this is just an idea I wanted to try out and see if folks like it and if it is worth pursuing.

Gotcha.
Seems reasonable if it's not helpful, and it's cheap to avoid it.