This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Add convenience APIs in updater to avoid needing MSSA.
ClosedPublic

Authored by asbirlea on Jun 19 2018, 1:50 PM.

Details

Summary

Ideally passes should not need to pass MSSA around and do all updates through the updater.
Add convenience APIs to help with that.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Jun 19 2018, 1:50 PM
asbirlea updated this revision to Diff 151973.Jun 19 2018, 1:54 PM

Rush edit.

LGTM after two nits are addressed. Thank you!

include/llvm/Analysis/MemorySSAUpdater.h
144 ↗(On Diff #151973)

nit: const Instruction *. (const MemoryAccess * above might/might not make sense, but here it seems trivially correct)

150 ↗(On Diff #151973)

As discussed offline, it probably makes the most sense here to just make make a getMemorySSA(), rather than having dumpMemorySSA()/verifyMemorySSA()/... wrappers

(Whether getMemorySSA returns a const MemorySSA * or MemorySSA * is up to you; I'm happy either way).

This revision is now accepted and ready to land.Jun 19 2018, 5:38 PM
asbirlea marked 2 inline comments as done.Jun 20 2018, 1:57 PM

Thank you for the review!

asbirlea updated this revision to Diff 152153.Jun 20 2018, 1:57 PM

Address comments.

This revision was automatically updated to reflect the committed changes.