diff options
| author | David Green <david.green@arm.com> | 2018-09-26 10:46:18 +0000 |
|---|---|---|
| committer | David Green <david.green@arm.com> | 2018-09-26 10:46:18 +0000 |
| commit | 353cb3d4e524555c3bc9b7e0b4f857675c08ea41 (patch) | |
| tree | 5a02391c7e707ec05d041c5d55a03ce3daaff6ab /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
| parent | 67572004df09bb342fc8ef92be96b5963071b3a6 (diff) | |
| download | bcm5719-llvm-353cb3d4e524555c3bc9b7e0b4f857675c08ea41.tar.gz bcm5719-llvm-353cb3d4e524555c3bc9b7e0b4f857675c08ea41.zip | |
[CodeGen] Enable tail calls for functions with NonNull attributes.
Adding NonNull as attributes to returned pointers has the unfortunate side
effect of disabling tail calls. This patch ignores the NonNull attribute when
we decide whether to tail merge, in the same way that we ignore the NoAlias
attribute, as it has no affect on the call sequence.
Differential Revision: https://reviews.llvm.org/D52238
llvm-svn: 343091
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index ec4451ffa75..d69e9589976 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1871,15 +1871,6 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB) { CallInst *CI = TailCalls[i]; CallSite CS(CI); - // Conservatively require the attributes of the call to match those of the - // return. Ignore noalias because it doesn't affect the call sequence. - AttributeList CalleeAttrs = CS.getAttributes(); - if (AttrBuilder(CalleeAttrs, AttributeList::ReturnIndex) - .removeAttribute(Attribute::NoAlias) != - AttrBuilder(CalleeAttrs, AttributeList::ReturnIndex) - .removeAttribute(Attribute::NoAlias)) - continue; - // Make sure the call instruction is followed by an unconditional branch to // the return block. BasicBlock *CallBB = CI->getParent(); |

