This is an archive of the discontinued LLVM Phabricator instance.

[RewriteStatepointsForGC] Strengthen invariants around BDVs
ClosedPublic

Authored by reames on Sep 3 2015, 2:20 PM.

Details

Reviewers
sanjoy
Summary

As a first step towards a new implementation of the base pointer inference algorithm, introduce an abstraction for BDVs, strengthen the assertions around them, and rewrite the BDV relation code in terms of the abstraction which includes an explicit notion of whether the BDV is also a base. The later is motivated by the fact we had a bug where insertelement was always assumed to be a base pointer even though the BDV code knew it wasn't. The strengthened assertions in this patch would have caught that bug.

The next step will be to separate the DefiningValueMap into a BDV use list cache (entirely within findBasePointers) and a base pointer cache. Having the former will allow me to use a deterministic visit order when visiting BDVs in the inference algorithm and remove a bunch of ordering related hacks. Before actually doing the last step, I'm likely going to extend the lattice with a 'BaseN' (seen only base inputs) state so that I can kill the post process optimization step.

Diff Detail

Event Timeline

reames updated this revision to Diff 33973.Sep 3 2015, 2:20 PM
reames retitled this revision from to [RewriteStatepointsForGC] Strengthen invariants around BDVs.
reames updated this object.
reames added a reviewer: sanjoy.
reames added a subscriber: llvm-commits.
sanjoy accepted this revision.Sep 3 2015, 2:29 PM
sanjoy edited edge metadata.

lgtm with minor nits addressed.

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
296

Nit: should be transitive.

310

I'd put isKnownBaseResult inside an #ifndef NDEBUG, otherwise you're computing isKnownBaseResult and throwing it away in non-asserts builds.

This revision is now accepted and ready to land.Sep 3 2015, 2:29 PM
reames closed this revision.Sep 4 2015, 11:26 AM

This landed in 246809 and linked back to this review. Not sure why it didn't get auto closed.