This is an archive of the discontinued LLVM Phabricator instance.

MemorySSA: Add support for renaming uses in the updater.
ClosedPublic

Authored by dberlin on Feb 18 2017, 10:17 PM.

Details

Summary

This lets one add aliasing stores to the updater.
(i'm next going to move the creation/etc functions to the updater)

Diff Detail

Repository
rL LLVM

Event Timeline

dberlin created this revision.Feb 18 2017, 10:17 PM
davide added a subscriber: davide.Feb 18 2017, 10:20 PM
  • Remove errant MSSA.dump added to unit test

The code logic looks fine. Some minor comments inline.

include/llvm/Transforms/Utils/MemorySSAUpdater.h
89–93 ↗(On Diff #89059)

Unrelated formatting, I guess.

lib/Transforms/Utils/MemorySSA.cpp
1187–1189 ↗(On Diff #89059)

Full stop at the ned of the comment (here and everywhere else)

unittests/Transforms/Utils/MemorySSA.cpp
193 ↗(On Diff #89059)

IIRC dump() is supposed to be used only in a debugger and print() should be used instead, but I might be wrong.

Oh, just realized I commented while you're updating. Oh well.

davide added inline comments.Feb 18 2017, 10:25 PM
lib/Transforms/Utils/MemorySSA.cpp
1915–1916 ↗(On Diff #89060)

unrelated formatting I think (also I think the #if is redundant if you mark dump() as LLVM_DUMP_METHOD?)

davide accepted this revision.Feb 18 2017, 11:30 PM

LGTM

This revision is now accepted and ready to land.Feb 18 2017, 11:30 PM
Prazek added inline comments.Feb 19 2017, 4:52 AM
include/llvm/Transforms/Utils/MemorySSA.h
692 ↗(On Diff #89060)

why 2 last params are not used?

unittests/Transforms/Utils/MemorySSA.cpp
186 ↗(On Diff #89060)

Shouldn't it have some EXPECTs checking that renaming happened?

handful o'nits to supplement piotr's comments, then this LGTM.

thanks!

include/llvm/Transforms/Utils/MemorySSAUpdater.h
66 ↗(On Diff #89060)

should this be ///?

lib/Transforms/Utils/MemorySSA.cpp
1188 ↗(On Diff #89060)

missing space between "multiple blocks"

1191 ↗(On Diff #89060)

please sink this into the if condition

1195 ↗(On Diff #89060)

please remove redundant parens

lib/Transforms/Utils/MemorySSAUpdater.cpp
299 ↗(On Diff #89060)

please do if (auto ... = dyn_cast<MemoryDef>(FirstDef)) instead

unittests/Transforms/Utils/MemorySSA.cpp
193 ↗(On Diff #89059)

please remove

dberlin marked 11 inline comments as done.Feb 19 2017, 5:42 PM
dberlin added inline comments.
include/llvm/Transforms/Utils/MemorySSA.h
692 ↗(On Diff #89060)

There is only one caller that should be using it.
I removed the params here.

include/llvm/Transforms/Utils/MemorySSAUpdater.h
66 ↗(On Diff #89060)

My understanding is that this isn't required anymore, but maybe i'm wrong?

dberlin marked an inline comment as done.
  • Update for review comments

LGTM. Thanks again!

include/llvm/Transforms/Utils/MemorySSAUpdater.h
66 ↗(On Diff #89060)

no clue. I'm happy to assume you're right; we can fix it later if doxygen doesn't like it. ¯\_(ツ)_/¯

Prazek added inline comments.Feb 20 2017, 6:12 AM
include/llvm/Transforms/Utils/MemorySSAUpdater.h
66 ↗(On Diff #89060)

I am not sure if doxygen will work, but I am used to doxygen comments for definitions because my ide color them differently :p

This revision was automatically updated to reflect the committed changes.