[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)
commit346ff628f7de3a04c2051053df3093820f6ae009
treeaacdd74891dd7f2445b0c3dcf47943131509ee64
parenta73f1fdb196758c93434e783c627e724b6d30f9a
[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

llvm-svn: 239472
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
llvm/test/CodeGen/X86/statepoint-stack-usage.ll