[StatepointLowering] Reuse stack slots across basic blocks
authorIgor Laevsky <igmyrj@gmail.com>
Wed, 10 Jun 2015 12:31:53 +0000 (12:31 +0000)
committerIgor Laevsky <igmyrj@gmail.com>
Wed, 10 Jun 2015 12:31:53 +0000 (12:31 +0000)
commit544d686bc0d6e10f483106829e4f7a69346d4b26
treecf9d25231cc1fea9fcc6941655ace20a41274447
parent4d13f315d1794f2d72dcf7240d97e9294e9db1f7
[StatepointLowering] Reuse stack slots across basic blocks

During statepoint lowering we can sometimes avoid spilling of the value if we know that it was already spilled for previous statepoint.
We were doing this by checking if incoming statepoint value was lowered into load from stack slot. This was working only in boundaries of one basic block.

But instead of looking at the lowered node we can look directly at the llvm-ir value and if it was gc.relocate (or some simple modification of it) look up stack slot for it's derived pointer and reuse stack slot from it. This allows us to look across basic block boundaries.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239472 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
test/CodeGen/X86/statepoint-stack-usage.ll