[RewriteStatepointsForGC] Generalized vector phi/select handling for base pointers
authorPhilip Reames <listmail@philipreames.com>
Fri, 26 Jun 2015 22:47:37 +0000 (22:47 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 26 Jun 2015 22:47:37 +0000 (22:47 +0000)
commit60d74b7101075b60689a7f0848f732d5bb8eff16
tree9767bcd150d36ee5b55d4fe4bc256cd6ffddbb4b
parenta70d990f47315e9197a0d704884e980e3d3a2fa2
[RewriteStatepointsForGC] Generalized vector phi/select handling for base pointers

This change extends the detection of base pointers for vector constructs to handle arbitrary phi and select nodes. The existing non-vector code already handles those, so this is basically just extending the vector special case to be less special cased. It still isn't generalized vector handling since we can't handle arbitrary vector instructions (e.g. shufflevectors), but it's a lot closer.

The general structure of the change is as follows:
 * Extend the base defining value relation over a subset of vector instructions and vector typed phi & select instructions.
 * Move scalarization from before base pointer rewriting to after base pointer rewriting. The extension of the BDV relation is sufficient to find vector base phis for vector inputs.
 * Preserve the existing special case logic for when the base of a vector element is locally obvious. This general idea could be extended to the scalar case as well.

Differential Revision: http://reviews.llvm.org/D10461#inline-84275

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