[llvm] [TLI] Support inferring function attributes for sincos[f|l] (PR #108554)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 07:14:38 PDT 2024


================
@@ -1270,6 +1270,18 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyWritesMemory(F);
     Changed |= setWillReturn(F);
     break;
+  case LibFunc_sincos:
+  case LibFunc_sincosf:
+  case LibFunc_sincosl:
+    Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotFreeMemory(F);
+    Changed |= setOnlyWritesMemory(F);
+    Changed |= setOnlyWritesMemory(F, 1);
+    Changed |= setOnlyWritesMemory(F, 2);
+    Changed |= setDoesNotCapture(F, 1);
+    Changed |= setDoesNotCapture(F, 2);
+    Changed |= setWillReturn(F);
----------------
MacDue wrote:

sincos can set errno, which I don't think would count as argmemonly?

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


More information about the llvm-commits mailing list