[llvm] [IR] Add `llvm.sincos` intrinsic (PR #109825)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 09:31:56 PDT 2024


================
@@ -5577,6 +5577,16 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
     Results.push_back(Tmp2.getValue(1));
     break;
   }
+  case ISD::FSINCOS: {
+    Tmp1 = DAG.getNode(ISD::FP_EXTEND, dl, NVT, Node->getOperand(0));
+    Tmp2 = DAG.getNode(ISD::FSINCOS, dl, {NVT, NVT}, Tmp1);
+
+    for (unsigned ResNum = 0; ResNum < Node->getNumValues(); ResNum++)
+      Results.push_back(
+          DAG.getNode(ISD::FP_ROUND, dl, OVT, Tmp2.getValue(ResNum),
+                      DAG.getIntPtrConstant(0, dl, /*isTarget=*/true)));
----------------
arsenm wrote:

Host this out of loop 

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


More information about the llvm-commits mailing list