[RewriteStatepointsForGC] Exclude constant values from being considered live at a...
authorPhilip Reames <listmail@philipreames.com>
Sun, 26 Apr 2015 19:48:03 +0000 (19:48 +0000)
committerPhilip Reames <listmail@philipreames.com>
Sun, 26 Apr 2015 19:48:03 +0000 (19:48 +0000)
commita404b6f4216dad6f171583ed58a2ec832c0762c4
tree03538aa5c57449027c8ca8219192cba4a49f7fec
parent83a049f2a65d6422049e094ad75cea2301b4f4b3
[RewriteStatepointsForGC] Exclude constant values from being considered live at a safepoint

There can be various constant pointers in the IR which do not get relocated at a safepoint. One example is the address of a global variable. Another example is a pointer created via inttoptr. Note that the optimizer itself likes to create such inttoptrs when locally propagating constants through dynamically dead code.

To deal with this, we need to exclude uses of constants from contributing to the liveness of a safepoint which might reach that use. At some later date, it might be worth exploring what could be done to support the relocation of various special types of "constants", but that's future work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235821 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
test/Transforms/RewriteStatepointsForGC/constants.ll [new file with mode: 0644]