[llvm] [X86][SelectionDAG] - Add support for llvm.canonicalize intrinsic (PR #106370)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 02:45:57 PDT 2024


================
@@ -1275,6 +1275,56 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
       }
     }
     break;
+    case ISD::FCANONICALIZE: {
+      const Triple &TT = DAG.getTarget().getTargetTriple();
+      if (TT.getArch() == Triple::x86 || TT.getArch() == Triple::x86_64) {
----------------
arsenm wrote:

You do not need ExpandConstantFP at all. You do not need to consider constants, regardless of the class. Legalization must work for all inputs, which covers constants materialized in registers 

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


More information about the llvm-commits mailing list