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

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 18:37:20 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);
----------------
v01dXYZ wrote:

1. we can isolate those Opcodes into another function.
2. keep them and overwrite the actions just after calling `setF16Action` if that's not the right ones (which is the path I've taken, and that's what's in the current code with `MVT::v16f16` for example).  

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


More information about the llvm-commits mailing list