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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 09:39:07 PDT 2024


================
@@ -21,3 +21,13 @@ entry:
   %4 = musttail call i32 (ptr, ...) @foo(ptr null, ...)
   ret i32 %4
 }
+
+declare i64 @llvm.llround.f32(float) nounwind readnone
+define range(i64 0, 8) i64 @testmsxs(float %x) {
+; CHECK-LABEL: testmsxs:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    jmp llroundf at PLT # TAILCALL
+    entry:
+        %0 = tail call i64 @llvm.llround.f32(float %x)
+   ret i64 %0
----------------
arsenm wrote:

```suggestion
   %ret = tail call i64 @llvm.llround.f32(float %x)
   ret i64 %ret
```

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


More information about the llvm-commits mailing list