Let me preface this by noting that I'm not yet comfortable with the constrained FP intrinsics implementation, so I'm posting this patch to initiate a conversation on how I should proceed...
I wrote some tests to exercise the vector variants of the constrained FP intrinsics and found that some of the vector lib calls may need special handling. E.g. vector POW on X86 is expanded. This will require special handling of STRICT_FPOW in VectorLegalizer::LegalizeOp(...).
To handle STRICT_FPOW, I followed the existing code in SelectionDAGLegalize::LegalizeOp(...), since I believe this is in line with the intended implementation for the STRICT_XXX opcodes.
That being said, it may be more maintainable to reuse a helper function that converts a STRICT_XXX into its corresponding XXX node early in the LegailizeOp(...) functions. For example,
if (Node->isStrictFPOpcode()) Node = DAG.mutateStrictFPToFP(Node);
Thoughts?
Do you actually want to mutate the node at this point?
There's a function, getStrictFPOpcodeAction() that does something very close to what you are doing here except without mutating the node. Would moving that to an accessible location do what you need?