[PATCH] D93040: [InlineFunction] Use llvm.experimental.noalias.scope.decl for noalias arguments.

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 02:28:20 PST 2021


jeroen.dobbelaere added a comment.

When working on a test with recursion and inlining, I was thinking about the differences between duplicating scopes in the unrolling (D92887 <https://reviews.llvm.org/D92887>) and duplicating the scopes during the inlining. The refactored code for the inlining keeps the same behavior as before and does a 'deep clone': all the MDNodes and there dependencies are cloned. So the scopes themselves become unique, but also the (function) domains to which they belong are duplicated.

In the utilities added for unrolling (D92887 <https://reviews.llvm.org/D92887>), only the scopes are duplicated. Their domains are kept. And that makes sense as the domain represents the function to which the scope belongs.
The side effect of this, is that the scope layout can be different with different pass orders: loop-unroll after inlining or inlining after loop-unroll will make a difference on how the domains are represented.

IMHO, it would make sense to not do the deep copy for inlining. The scope domain of the inlined function can be kept and shared by multiple functions and multiple inlines, as long as the scopes themselves are unique.
On the other hand, a change in the domain handling can have an effect on the speed of analysis, as an initial filtering is done based on the domains. I don't think we should do this kind of change right now, but it is something we can keep in mind.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93040/new/

https://reviews.llvm.org/D93040



More information about the llvm-commits mailing list