[RewriteStatepointsForGC] Strengthen invariants around BDVs
authorPhilip Reames <listmail@philipreames.com>
Thu, 3 Sep 2015 21:34:30 +0000 (21:34 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 3 Sep 2015 21:34:30 +0000 (21:34 +0000)
commitf95c45d16ff4f6f3e54d56876e49b8c1243dd8e5
treef8fe61c1f69adb1731f2b18b8ad1fbf3a530c22f
parentbf6bd487d5bd3f8066fa6e5076d7de3988b4be76
[RewriteStatepointsForGC] Strengthen invariants around BDVs

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.

Phabricator Revision: http://reviews.llvm.org/D12608

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246809 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp