[InlineFunction] Only update noalias scopes once for an instruction.
authorJeroen Dobbelaere <jeroen.dobbelaere@synopsys.com>
Tue, 2 Feb 2021 16:55:06 +0000 (17:55 +0100)
committerJeroen Dobbelaere <jeroen.dobbelaere@synopsys.com>
Tue, 2 Feb 2021 16:57:10 +0000 (17:57 +0100)
commit50c523a9d4402c69d59c0b2ecb383a763d16cde9
tree49b130df07601aa349c0b2a7fbcef656ae0016bf
parent3e780616c46ecd2caa8f52e714839b87a39f514b
[InlineFunction] Only update noalias scopes once for an instruction.

Inlining sometimes maps different instructions to be inlined onto the same instruction.

We must ensure to only remap the noalias scopes once. Otherwise the scope might disappear (at best).
This patch ensures that we only replace scopes for which the mapping is known.

This approach is preferred over tracking which instructions we already handled in a SmallPtrSet,
as that one will need more memory.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D95862
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/test/Transforms/Inline/noalias3.ll [new file with mode: 0644]