OSDN Git Service

[CGP] Fix the rematerialization of gc.relocates
authorSerguei Katkov <serguei.katkov@azul.com>
Thu, 17 Aug 2017 05:48:30 +0000 (05:48 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Thu, 17 Aug 2017 05:48:30 +0000 (05:48 +0000)
commita01b42e49a7d0405981436916be8a68c1d5ba798
treec08c2a29178d16ae0cea4a0471c66cfc8d245369
parenta6a5be21dfa2020a133919d7bc96391a620ea5a7
[CGP] Fix the rematerialization of gc.relocates

If we want to substitute the relocation of derived pointer with gep of base then
we must ensure that relocation of base dominates the relocation of derived pointer.

Currently only check for basic block is present. However it is possible that both
relocation are in the same basic block but relocation of derived pointer is defined
earlier.

The patch moves the relocation of base pointer right before relocation of derived
pointer in this case.

Reviewers: sanjoy,artagnon,igor-laevsky,reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311067 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/statepoint-relocate.ll