This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Make Phi cleanups consistent.
ClosedPublic

Authored by asbirlea on Aug 19 2019, 5:05 PM.

Details

Summary

Make Phi cleanups consistent: remove self as a trivial Phi and
recurse to potentially remove other trivial phis.

Diff Detail

Event Timeline

asbirlea created this revision.Aug 19 2019, 5:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2019, 5:05 PM
asbirlea updated this revision to Diff 216234.Aug 20 2019, 1:42 PM

Make this purely a cleanup patch.

asbirlea edited the summary of this revision. (Show Details)Aug 20 2019, 1:48 PM

Assuming the test in D66495 (in part) covers this, LGTM with an optional nit.

Thanks!

lib/Analysis/MemorySSAUpdater.cpp
490

do we have many more calls like this laying around?

if so, would it be good to add a super simple overload that just takes a MPhi, asserts it's non-null, and expands to tryRemoveTrivialPhi(MPhi, MPhi->operands());?

This revision is now accepted and ready to land.Aug 20 2019, 2:54 PM
asbirlea updated this revision to Diff 216272.Aug 20 2019, 3:44 PM
asbirlea marked an inline comment as done.

Address comment.

This revision was automatically updated to reflect the committed changes.