diff options
author | Dávid Bolvanský <david.bolvansky@gmail.com> | 2019-11-06 23:07:17 +0100 |
---|---|---|
committer | Dávid Bolvanský <david.bolvansky@gmail.com> | 2019-11-06 23:08:07 +0100 |
commit | 62ad2128255877ed41c714366861eee9c1da30dd (patch) | |
tree | 53b0a915153ae008f96ddd703296de12be58c75a /llvm/lib/CodeGen/Analysis.cpp | |
parent | 77a60f0df673074a2c9276498f95a9eaadeece56 (diff) | |
download | bcm5719-llvm-62ad2128255877ed41c714366861eee9c1da30dd.tar.gz bcm5719-llvm-62ad2128255877ed41c714366861eee9c1da30dd.zip |
[Analysis] Attribute deref/deref_or_null should not prevent tail call optimization
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/Analysis.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp index 023c2367af0..4b738ca0e94 100644 --- a/llvm/lib/CodeGen/Analysis.cpp +++ b/llvm/lib/CodeGen/Analysis.cpp @@ -567,12 +567,16 @@ bool llvm::attributesPermitTailCall(const Function *F, const Instruction *I, AttrBuilder CalleeAttrs(cast<CallInst>(I)->getAttributes(), AttributeList::ReturnIndex); - // NoAlias and NonNull are completely benign as far as calling convention + // Following attributes are completely benign as far as calling convention // goes, they shouldn't affect whether the call is a tail call. CallerAttrs.removeAttribute(Attribute::NoAlias); CalleeAttrs.removeAttribute(Attribute::NoAlias); CallerAttrs.removeAttribute(Attribute::NonNull); CalleeAttrs.removeAttribute(Attribute::NonNull); + CallerAttrs.removeAttribute(Attribute::Dereferenceable); + CalleeAttrs.removeAttribute(Attribute::Dereferenceable); + CallerAttrs.removeAttribute(Attribute::DereferenceableOrNull); + CalleeAttrs.removeAttribute(Attribute::DereferenceableOrNull); if (CallerAttrs.contains(Attribute::ZExt)) { if (!CalleeAttrs.contains(Attribute::ZExt)) |