[llvm] [Analysis] Attribute Range should not prevent tail call optimization (PR #91122)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 01:46:51 PDT 2024


================
@@ -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}) {
----------------
nikic wrote:

We kind of have this in https://github.com/llvm/llvm-project/blob/d98a78590f4f9e43fdfb69fde7d154a985e4560f/llvm/lib/IR/Attributes.cpp#L2021, but it's currently mixed together with typeIncompatible(). It would make sense to separate it out.

https://github.com/llvm/llvm-project/pull/91122


More information about the llvm-commits mailing list