[llvm] [X86][NVPTX][LegalizeDAG] If i16 legal, legalize FABS/FNEG/FCOPYSIGN (f16) with Expand (PR #106153)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 18:47:26 PDT 2024


================
@@ -601,7 +601,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
   auto setF16Action = [&] (MVT VT, LegalizeAction Action) {
     setOperationAction(ISD::FABS, VT, Action);
     setOperationAction(ISD::FNEG, VT, Action);
-    setOperationAction(ISD::FCOPYSIGN, VT, Expand);
+    setOperationAction(ISD::FCOPYSIGN, VT, Action);
----------------
phoebewang wrote:

I was thinking you meant `FCOPYSIGN` is set Expand by default, then I got you mean it's all set Expand in X86ISelLowering.cpp.
Just have a double check, it does set Expand by default, see
https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/TargetLoweringBase.cpp#L775
So we can simply remove it from `setF16Action`.

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


More information about the llvm-commits mailing list