diff options
author | Jinsong Ji <jinsong.ji@intel.com> | 2024-05-07 19:02:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 22:02:10 -0400 |
commit | 2dade0041a62b192e9bde24ae6bbe6208f027523 (patch) | |
tree | 8f6b4e64b197b1915cbd0978556136a4ada983d5 /llvm/lib/CodeGen/Analysis.cpp | |
parent | c4e5a8a4d3ef0948384d9411ea1e44fc113e5b5c (diff) | |
download | llvm-2dade0041a62b192e9bde24ae6bbe6208f027523.zip llvm-2dade0041a62b192e9bde24ae6bbe6208f027523.tar.gz llvm-2dade0041a62b192e9bde24ae6bbe6208f027523.tar.bz2 |
[Analysis] Attribute Range should not prevent tail call optimization (#91122)
- Remove Range attr when comparing for tailcall
- Add test for testcall with range
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/Analysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp index af7643d..e693cdb 100644 --- a/llvm/lib/CodeGen/Analysis.cpp +++ b/llvm/lib/CodeGen/Analysis.cpp @@ -593,9 +593,10 @@ bool llvm::attributesPermitTailCall(const Function *F, const Instruction *I, // Following attributes are completely benign as far as calling convention // goes, they shouldn't affect whether the call is a tail call. - for (const auto &Attr : {Attribute::Alignment, Attribute::Dereferenceable, - Attribute::DereferenceableOrNull, Attribute::NoAlias, - Attribute::NonNull, Attribute::NoUndef}) { + for (const auto &Attr : + {Attribute::Alignment, Attribute::Dereferenceable, + Attribute::DereferenceableOrNull, Attribute::NoAlias, + Attribute::NonNull, Attribute::NoUndef, Attribute::Range}) { CallerAttrs.removeAttribute(Attr); CalleeAttrs.removeAttribute(Attr); } |