This is an archive of the discontinued LLVM Phabricator instance.

[RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer algorithm [NFC]
ClosedPublic

Authored by reames on Jul 23 2015, 4:18 PM.

Details

Summary

The new code should hopefully be equivalent to the old code; it just uses a worklist to track instructions which need to visited rather than iterating over all instructions visited each time. This should be faster, but the primary benefit is that the purpose should be more clear and the diff of adding another instruction type (forthcoming) much more obvious.

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 30538.Jul 23 2015, 4:18 PM
reames retitled this revision from to [RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer algorithm [NFC].
reames updated this object.
reames added a reviewer: sanjoy.
reames added a subscriber: llvm-commits.
sanjoy added inline comments.Jul 23 2015, 4:39 PM
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
731 ↗(On Diff #30538)

Why does this need to be a SetVector (as opposed to some variant of a set)?

734 ↗(On Diff #30538)

I'd put an assert(!isKnownBaseResult(Base)) to make it obvious what's going on.

750 ↗(On Diff #30538)

insert (for SetVector and other set variants) returns a bool stating if the value was present in the set. So you don't need to call both .count and .insert.

sanjoy accepted this revision.Jul 23 2015, 4:53 PM
sanjoy edited edge metadata.

LGTM with the previous comments addressed.

This revision is now accepted and ready to land.Jul 23 2015, 4:53 PM
This revision was automatically updated to reflect the committed changes.