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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 08:24:11 PDT 2024


================
@@ -4749,6 +4755,14 @@ void DAGTypeLegalizer::WidenVectorResult(SDNode *N, unsigned ResNo) {
   case ISD::VP_FSHR:
     Res = WidenVecRes_Ternary(N);
     break;
+  case ISD::FSINCOS: {
+    if (!unrollExpandedOp())
+      Res = WidenVecRes_FSINCOS(N);
+    for (unsigned ResNum = 0; ResNum < N->getNumValues(); ResNum++)
+      SetWidenedVector(SDValue(N, ResNum), Res.getValue(ResNum));
+    Res = SDValue();
----------------
MacDue wrote:

> Is it worth creating a WidenVecRes_UnaryOpWithTwoResults for this? (it seems FREXPR is missing in this switch statement)

It may be, but I think creating something to handle both `FFREXP` and `FSINCOS` may take a little more care. `FSINCOS` is easy as both results are the same type (so have the same legalization action), but that might be something that needs handling differently for `FFREXP` (which returns an int and a float).

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


More information about the llvm-commits mailing list