OSDN Git Service

[RewriteStatepointsForGC] All constant should have null base pointer
authorIgor Laevsky <igmyrj@gmail.com>
Fri, 27 May 2016 13:13:59 +0000 (13:13 +0000)
committerIgor Laevsky <igmyrj@gmail.com>
Fri, 27 May 2016 13:13:59 +0000 (13:13 +0000)
commitceb0f307b3ac11aad61242d75215db1234b4b3b7
tree3c25f5976834ad2fcb652f8714c0ae71f6f7fcc8
parentfbe10c22e1d837e5f78d1eb41aebbf21ab954dd2
[RewriteStatepointsForGC] All constant should have null base pointer

Currently we consider that each constant has itself as a base value. I.e "base(const) = const".
This introduces couple of problems when we are trying to avoid reporting constants in statepoint live sets:

1. When querying "base( phi(const1, const2) )" we will get "phi(const1, const2)" as a base pointer. Since
   it's not a constant we will record it in a stack map. However on practice we don't want this to happen
   (constant are never relocated).
2. base( phi(const, gc ptr) ) = phi( const, base(gc ptr) ). This particular case imposes challenge on our
   runtime - we don't expect to see constant base pointers other than null. This problems can be avoided
   by treating all constant as if they were derived from null pointer base. I.e in a first case we will
   not include constant pointer in a stack map at all. In a second case we will get "phi(null, base(gc ptr))"
   as a base pointer which is a lot more convenient.

Differential Revision: http://reviews.llvm.org/D20584

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270993 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
test/Transforms/RewriteStatepointsForGC/base-vector.ll
test/Transforms/RewriteStatepointsForGC/constants.ll