Try not to resize vector of call records in a call graph node when
replacing call edge. That would prevent invalidation of iterators
stored in the CG SCC pass manager's scc_iterator.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This is a "fix" for the failure we see only if the number of callbacks is the same, correct?
Comment Actions
Yes, exactly. If the number of callbacks is the same we can avoid invalidating iterators. I assume that should really cover most of the cases.
Comment Actions
Added unit test for the CallGraphNode::replaceCallEdge() change. Without this change test finishes with an assertion on windows debug build.
Comment Actions
LGTM. This is not "great" but one of those shortcomings of the legacy CG we can work around in the hops it will be removed soon.
FWIW, in the absence of callbacks this should not cause much cost and be a no-op.