This is an archive of the discontinued LLVM Phabricator instance.

Fix memory access local dominance function for live on entry
ClosedPublic

Authored by sebpop on Jun 6 2016, 1:11 PM.

Details

Summary

A memory access defined on function entry cannot be locally dominated by another memory access.
The patch was split from D19338 which exposes the problem.

Diff Detail

Repository
rL LLVM

Event Timeline

sebpop updated this revision to Diff 59770.Jun 6 2016, 1:11 PM
sebpop retitled this revision from to Fix memory access local dominance function for live on entry.
sebpop updated this object.
sebpop set the repository for this revision to rL LLVM.
sebpop added a subscriber: llvm-commits.
george.burgess.iv accepted this revision.Jun 6 2016, 1:30 PM
george.burgess.iv edited edge metadata.

Thanks for the patch!

ISTM this function is a bit broken in general if Dominator == Dominatee (since a node technically does dominate itself). I know it's my fault, but can you add a check for that as well, please? :)

Other than that, LGTM with a comment.

llvm/lib/Transforms/Utils/MemorySSA.cpp
629

Can we please have a check for isLiveOnEntryDef(Dominator), too? liveOnEntry has a null BB, so I don't see things ending well if we let that through.

This revision is now accepted and ready to land.Jun 6 2016, 1:30 PM
llvm/lib/Transforms/Utils/MemorySSA.cpp
629

...Scratch the "liveOnEntry has a null BB, so I don't see things ending well if we let that through" bit. We do set liveOnEntry's BB to a non-null value in getWalker() :)

(This is what I get for not verifying the assertions that I make before I hit "reply" ;). My bad.)

sebpop updated this revision to Diff 59781.Jun 6 2016, 2:10 PM
sebpop edited edge metadata.
sebpop removed rL LLVM as the repository for this revision.

Updated patch to address the comments from George Burgess IV.

This revision was automatically updated to reflect the committed changes.