[mlir][LLVM] Append call ops alias scopes to inlined operations
authorMarkus Böck <markus.bock+llvm@nextsilicon.com>
Tue, 18 Jul 2023 13:23:27 +0000 (15:23 +0200)
committerMarkus Böck <markus.bock+llvm@nextsilicon.com>
Tue, 18 Jul 2023 14:26:17 +0000 (16:26 +0200)
commitcde72af3dbb68dd3cc3b1012225551ccf3879713
tree52af986700a3deedb66ee5b0f693b71d30995532
parentef240e942a0c6144bddb61567c7c4eed0c9d4722
[mlir][LLVM] Append call ops alias scopes to inlined operations

Currently when inlining, any alias scope information previously attached to the call op is lost. This leads to a loss of information that could be used by alias analysis to determine that two memory access operations do not alias.

This patch fixes this issue by also taking any alias scopes of the call operation into account. These can then simply be appended onto any inlined operations.

This is analogous to the following code in LLVM: https://github.com/llvm/llvm-project/blob/1768c4597e70477af2d69f576f33400181a5f945/llvm/lib/Transforms/Utils/InlineFunction.cpp#L940

Differential Revision: https://reviews.llvm.org/D155595
mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp
mlir/test/Dialect/LLVMIR/inlining-alias-scopes.mlir