Page MenuHomePhabricator

[MemorySSA] Fix existing phis when inserting defs.
ClosedPublic

Authored by asbirlea on Aug 20 2019, 1:43 PM.

Details

Summary

When inserting a new Def, and inserting Phis in the IDF when needed,
also mark the already existing Phis in the IDF as non-optimized, since
these may need fixing as well.
In the test attached, there is a Phi in the IDF that happens to be
trivial, and is wrongfully removed by the call to getLastDef that
follows. This is a valid situation and the existing IDF Phis need to
marked as "may need fixing" as well.
Resolves PR43044.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Aug 20 2019, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2019, 1:43 PM

Thanks!

lib/Analysis/MemorySSAUpdater.cpp
355 ↗(On Diff #216236)

this is somewhat surprising to me, so please add to this comment some kind of pointer to PR43044 and/or test/Analysis/MemorySSA/PR43044.ll. that way, understanding why this happens is a bit easier for future interested parties :)

This revision is now accepted and ready to land.Aug 20 2019, 2:57 PM
This revision was automatically updated to reflect the committed changes.