This is an archive of the discontinued LLVM Phabricator instance.

[RewriteStatepoints] Fix incorrect assertion
ClosedPublic

Authored by mkazantsev on Dec 27 2017, 4:09 AM.

Details

Summary

RewriteStatepointsForGC iterates over function blocks and their predecessors
in order of declaration. One of outcomes of this is that callsites are placed in
arbitrary order which has nothing to do with travelsar order.

On the other hand, function recomputeLiveInValues asserts that bases are
added to Info.PointerToBase before their deried pointers are updated. But
if call sites are processed in order different from RPOT, this is not necessarily
true. We cannot guarantee that the base was placed there before every
pointer derived from it. All we can guarantee is that this base was marked as
known base by this point.

This patch replaces the fact that we assert from checking that the base was
added to the map with assert that the base was marked as known base.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Dec 27 2017, 4:09 AM

Simplified test slightly.

dneilson accepted this revision.Dec 27 2017, 6:40 AM

I think that this is okay.

This revision is now accepted and ready to land.Dec 27 2017, 6:40 AM
This revision was automatically updated to reflect the committed changes.