Fix PR36484, as suggested:
<quote>
during moves, mark the direct users of the erased things that were phis as "not to be optimized"
<quote>
Differential D44257
[MemorySSAUpdater] Mark non-trivial Phi for not to optimize zzheng on Mar 8 2018, 9:54 AM. Authored by
Details Fix PR36484, as suggested: <quote>
Diff Detail
Event TimelineComment Actions Please commit the spelling corrections in lib/Analysis/MemorySSA.cpp separately. This looks right, but I'm not that familiar with the algorithm; hopefully Daniel will chime in.
Comment Actions This looks right to me (IE if it's wrong, i'm wrong about what will work, it looks implemented correctly) Comment Actions Thanks for the patch! Just one nit (inline) and a general question: is this new set meant to persist across multiple updates, should the erase in fixupDefs be taking care of everything added in a given query, or should we be clearing it at some point? (If the answer is "the middle one," would it be easy to assert that the def is empty somewhere?)
+1.
Comment Actions
At least two GVN-hoist test cases need NonOptPhis be cleared. The patch is scoped at per call of MemorySSAUpdater::moveTo(), so clean-up is placed at the end of this function. Comment Actions I'll run a bunch of internal test to validate the patch. I'll commit it after testing if no one objects. |
Can you use AssertingVH<MemoryPHI> here? I don't think you can get any dangling pointers with your algorithm, but it's nice to add some extra checks.