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

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 11:04:15 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) {
----------------
andykaylor wrote:

@arsenm Apart from the positive-zero handling, is there anything here that shouldn't be target-independent? Given how many targets already support canonicalize, I'm a bit surprised that there would be any new target-independent code needed. It seems that the other targets have pattern-matching lowering for the intrinsic. Is that preferable to the approach taken here?

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


More information about the llvm-commits mailing list