This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] Append call ops alias scopes to inlined operations
ClosedPublic

Authored by zero9178 on Jul 18 2023, 6:26 AM.

Details

Summary

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

Diff Detail

Event Timeline

zero9178 created this revision.Jul 18 2023, 6:26 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
zero9178 requested review of this revision.Jul 18 2023, 6:26 AM
definelicht added inline comments.Jul 18 2023, 6:39 AM
mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp
190

"Requires" is a bit strong: If both are null, this just returns null, so I would write that explicitly.

200

You already checked that lhs it not null, so no need for the ternary operator I think?

zero9178 updated this revision to Diff 541509.Jul 18 2023, 6:45 AM
zero9178 marked 2 inline comments as done.

Address review comments

This revision is now accepted and ready to land.Jul 18 2023, 7:06 AM
This revision was landed with ongoing or failed builds.Jul 18 2023, 7:27 AM
This revision was automatically updated to reflect the committed changes.