This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Make `LocalAliasAnalysis` extesible
ClosedPublic

Authored by Hardcode84 on Dec 19 2022, 1:28 PM.

Details

Summary

This is an alternative to https://reviews.llvm.org/D138761 . Instead of adding ad-hoc attributes to existing LocalAliasAnalysis, expose aliasImpl method so user can override it.

Diff Detail

Event Timeline

Hardcode84 created this revision.Dec 19 2022, 1:28 PM
Hardcode84 requested review of this revision.Dec 19 2022, 1:28 PM
bondhugula added inline comments.
mlir/test/lib/Analysis/TestAliasAnalysis.cpp
162

getParentOp can return null.

isa_and_non_null.

168

Likewise.

221–224

Add in sorted order.

Add null check

Hardcode84 marked 2 inline comments as done.Dec 20 2022, 7:32 AM
Hardcode84 added inline comments.
mlir/test/lib/Analysis/TestAliasAnalysis.cpp
168

We can only get there if previous check succeeded so we will never get null.

bondhugula accepted this revision.Dec 20 2022, 7:56 PM

LGTM. On a note unrelated to this PR but on this topic, besides aliasImpl, I feel even collectUnderlyingAddressValues should be exposed. Currently, the alias analysis framework can only answer "can two values alias", but not "provide me all the values that could potentially alias with a given Value" (at least locally).

This revision is now accepted and ready to land.Dec 20 2022, 7:56 PM
bondhugula added inline comments.Dec 20 2022, 7:57 PM
mlir/test/lib/Analysis/TestAliasAnalysis.cpp
166

Please add doc comment to this one and the one above although they may appear trivial now.

191

Doc comment.

rriddle accepted this revision.Dec 20 2022, 10:37 PM

Looks reasonable to me as a step forward.

Add comments

This revision was automatically updated to reflect the committed changes.