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

Pawan Nirpal via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 31 01:19:02 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) {
----------------
pawan-nirpal-031 wrote:

Hi Phoebe, I agree, 1 looks like a cleaner implementation, The disadvantage there is every target will have duplicated code, Note that only AMDGPU has implemented the intrinsic, no other target. Refer https://github.com/llvm/llvm-project/pull/106370#discussion_r1735775923 

2 doesn't seem a clean implementation. Which is why I'm leaning towards 3, to avoid code duplication.  

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


More information about the llvm-commits mailing list