This is an archive of the discontinued LLVM Phabricator instance.

[RewriteStatepointsForGC] Bugfix for change 246133
ClosedPublic

Authored by reames on Sep 2 2015, 2:57 PM.

Details

Summary

Fix a bug in change 246133. I didn't handle the case where we had a cycle in the use graph and could add an instruction we were about to erase back on to the worklist. Oddly, I have not been able to write a small test case for this, even with the AssertingVH added. I have confirmed the basic theory for the fix on a large failing example, but all attempts to reduce that to something appropriate for a test case have failed.

Diff Detail

Event Timeline

reames updated this revision to Diff 33859.Sep 2 2015, 2:57 PM
reames retitled this revision from to [RewriteStatepointsForGC] Bugfix for 246133.
reames updated this object.
reames added a reviewer: sanjoy.
reames added a subscriber: llvm-commits.
reames retitled this revision from [RewriteStatepointsForGC] Bugfix for 246133 to [RewriteStatepointsForGC] Bugfix for change 246133.Sep 2 2015, 3:06 PM
reames updated this revision to Diff 33863.Sep 2 2015, 3:09 PM

Fix minor whitespace issue.

sanjoy accepted this revision.Sep 2 2015, 3:16 PM
sanjoy edited edge metadata.

lgtm with minor nits inline.

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
616

Not directly related to this change, but does this invariant actually hold? We're constructing a BDVState below with status == Conflict and a non-nullptr base.

1048

Can there be non Instruction uses of BaseI. If not, maybe this should be a cast<>?

1056

Can we assert states.count(BDV) here? Or maybe even states[BDV].base == BaseI?

This revision is now accepted and ready to land.Sep 2 2015, 3:16 PM
reames added inline comments.Sep 2 2015, 3:19 PM
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
616

The comment does need updated. Actually, I think I should just extend the Status enum to include a new state because that's really what this is.

1048

I'm not sure about metadata and other weird values. I'd prefer to leave this as is.

1056

Yep, will do.

This revision was automatically updated to reflect the committed changes.