diff options
author | Igor Laevsky <igmyrj@gmail.com> | 2015-11-03 18:37:40 +0000 |
---|---|---|
committer | Igor Laevsky <igmyrj@gmail.com> | 2015-11-03 18:37:40 +0000 |
commit | f637b4a52e02cab4b95472898e29318604be8889 (patch) | |
tree | cd4722a44f256a562f11bdaf7e337fd6e47647b7 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 32d68fec561ea4622dbc11480c21e083f3fd7397 (diff) | |
download | bcm5719-llvm-f637b4a52e02cab4b95472898e29318604be8889.tar.gz bcm5719-llvm-f637b4a52e02cab4b95472898e29318604be8889.zip |
[CodegenPrepare] Do not rematerialize gc.relocates across different basic blocks
Differential Revision: http://reviews.llvm.org/D14258
llvm-svn: 251957
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 76ca1350b41..de5c68f7767 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -589,6 +589,14 @@ simplifyRelocatesOffABase(IntrinsicInst *RelocatedBase, continue; } + if (RelocatedBase->getParent() != ToReplace->getParent()) { + // Base and derived relocates are in different basic blocks. + // In this case transform is only valid when base dominates derived + // relocate. However it would be too expensive to check dominance + // for each such relocate, so we skip the whole transformation. + continue; + } + Value *Base = ThisRelocate.getBasePtr(); auto Derived = dyn_cast<GetElementPtrInst>(ThisRelocate.getDerivedPtr()); if (!Derived || Derived->getPointerOperand() != Base) |