diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-01-29 09:03:35 +0000 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-01-29 09:03:35 +0000 |
commit | 5ed4d4638fcd73b69ff07bd769bef070babcf550 (patch) | |
tree | 0825a0e36bd1ff8b46fe2f88b2ba5c654ad39fb6 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | d27bec48542e9638ff41033ad714e90207b53c68 (diff) | |
download | llvm-5ed4d4638fcd73b69ff07bd769bef070babcf550.zip llvm-5ed4d4638fcd73b69ff07bd769bef070babcf550.tar.gz llvm-5ed4d4638fcd73b69ff07bd769bef070babcf550.tar.bz2 |
[CodeGenPrepare] Handle all debug calls in dupRetToEnableTailCallOpts()
This patch makes sure that a debug value that is after the bitcast in
dupRetToEnableTailCallOpts() is also skipped.
The reduced test case is from SPEC-2006 on SystemZ.
Review: Vedant Kumar, Wolfgang Pieb
https://reviews.llvm.org/D57050
llvm-svn: 352462
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 067f708..486290d 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1845,10 +1845,8 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB) { // return is the first instruction in the block. if (PN) { BasicBlock::iterator BI = BB->begin(); - do { ++BI; } while (isa<DbgInfoIntrinsic>(BI)); - if (&*BI == BCI) - // Also skip over the bitcast. - ++BI; + // Skip over debug and the bitcast. + do { ++BI; } while (isa<DbgInfoIntrinsic>(BI) || &*BI == BCI); if (&*BI != RetI) return false; } else { |