This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Make the Updater movable.
AbandonedPublic

Authored by asbirlea on Aug 20 2018, 4:44 PM.

Details

Summary

Make the MemorySSAUpdater movable.

Diff Detail

Event Timeline

asbirlea created this revision.Aug 20 2018, 4:44 PM
chandlerc added inline comments.Aug 20 2018, 4:47 PM
include/llvm/Analysis/MemorySSAUpdater.h
76

You don't zero it out in the move constructor, why do it here? Do we do something in the destructor with it, if so it should be in both?

Also, if we do need this, s/0/nullptr/

asbirlea updated this revision to Diff 161623.Aug 20 2018, 4:52 PM

Nope, don't need that.

asbirlea marked an inline comment as done.Aug 20 2018, 4:52 PM
include/llvm/Analysis/MemorySSAUpdater.h
73

Can we = default;? I'd imagine the associated Small* data structures are really cheap to move/etc. if they're empty.

If not, that's sad, but OK, this works. :)

74

nit: please clang-format

chandlerc added inline comments.Aug 20 2018, 4:54 PM
include/llvm/Analysis/MemorySSAUpdater.h
73

We shouldn't need to write it at all if that worked....

I think the issue is the SmallSet of AssertingVH's?

chandlerc added inline comments.Aug 20 2018, 4:55 PM
include/llvm/Analysis/MemorySSAUpdater.h
73

This does raise the point that as-is, this is a very surprising move constructor.

I'd suggest moving all members somewhat pedantically to make it less surprising. And you might need to clear the actual AssertingVH container after that so that, not sure.

asbirlea abandoned this revision.Aug 21 2018, 4:34 PM

Dropping this, updater is movable, some mishap on my side.