[llvm] [CodeGen] Virtualize isTargetStrictFPOpcode / isTargetMemoryOpcode (PR #119969)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 05:57:24 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 10f23d116baa221707d8831d3c34f38f511c408e 7f87dace4c3a70ca9e937fe93f780ad43cbddcd8 --extensions h,cpp -- llvm/lib/Target/AMDGPU/AMDGPUSelectionDAGInfo.cpp llvm/lib/Target/AMDGPU/AMDGPUSelectionDAGInfo.h llvm/lib/Target/Mips/MipsSelectionDAGInfo.cpp llvm/lib/Target/Mips/MipsSelectionDAGInfo.h llvm/lib/Target/NVPTX/NVPTXSelectionDAGInfo.cpp llvm/lib/Target/NVPTX/NVPTXSelectionDAGInfo.h llvm/lib/Target/PowerPC/PPCSelectionDAGInfo.cpp llvm/lib/Target/PowerPC/PPCSelectionDAGInfo.h llvm/lib/Target/RISCV/RISCVSelectionDAGInfo.cpp llvm/lib/Target/RISCV/RISCVSelectionDAGInfo.h llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/include/llvm/CodeGen/SelectionDAG.h llvm/include/llvm/CodeGen/SelectionDAGNodes.h llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGTargetInfo.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.h llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.h llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h llvm/lib/Target/AMDGPU/GCNSubtarget.cpp llvm/lib/Target/AMDGPU/GCNSubtarget.h llvm/lib/Target/AMDGPU/R600Subtarget.cpp llvm/lib/Target/AMDGPU/R600Subtarget.h llvm/lib/Target/ARM/ARMISelLowering.h llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp llvm/lib/Target/ARM/ARMSelectionDAGInfo.h llvm/lib/Target/Mips/MipsISelLowering.h llvm/lib/Target/Mips/MipsSubtarget.cpp llvm/lib/Target/Mips/MipsSubtarget.h llvm/lib/Target/NVPTX/NVPTXISelLowering.h llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp llvm/lib/Target/NVPTX/NVPTXSubtarget.h llvm/lib/Target/PowerPC/PPCISelLowering.h llvm/lib/Target/PowerPC/PPCSubtarget.cpp llvm/lib/Target/PowerPC/PPCSubtarget.h llvm/lib/Target/RISCV/RISCVISelLowering.cpp llvm/lib/Target/RISCV/RISCVISelLowering.h llvm/lib/Target/RISCV/RISCVSubtarget.cpp llvm/lib/Target/RISCV/RISCVSubtarget.h llvm/lib/Target/RISCV/RISCVTargetMachine.h llvm/lib/Target/SystemZ/SystemZISelLowering.h llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.h llvm/lib/Target/X86/X86ISelLowering.cpp llvm/lib/Target/X86/X86ISelLowering.h llvm/lib/Target/X86/X86SelectionDAGInfo.cpp llvm/lib/Target/X86/X86SelectionDAGInfo.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h
index ae56bf7c8a..06c6c85f03 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.h
+++ b/llvm/lib/Target/Mips/MipsISelLowering.h
@@ -52,210 +52,210 @@ class TargetRegisterClass;
 
   namespace MipsISD {
 
-    enum NodeType : unsigned {
-      // Start the numbering from where ISD NodeType finishes.
-      FIRST_NUMBER = ISD::BUILTIN_OP_END,
+  enum NodeType : unsigned {
+    // Start the numbering from where ISD NodeType finishes.
+    FIRST_NUMBER = ISD::BUILTIN_OP_END,
 
-      // Jump and link (call)
-      JmpLink,
+    // Jump and link (call)
+    JmpLink,
 
-      // Tail call
-      TailCall,
+    // Tail call
+    TailCall,
 
-      // Get the Highest (63-48) 16 bits from a 64-bit immediate
-      Highest,
+    // Get the Highest (63-48) 16 bits from a 64-bit immediate
+    Highest,
 
-      // Get the Higher (47-32) 16 bits from a 64-bit immediate
-      Higher,
+    // Get the Higher (47-32) 16 bits from a 64-bit immediate
+    Higher,
 
-      // Get the High 16 bits from a 32/64-bit immediate
-      // No relation with Mips Hi register
-      Hi,
+    // Get the High 16 bits from a 32/64-bit immediate
+    // No relation with Mips Hi register
+    Hi,
 
-      // Get the Lower 16 bits from a 32/64-bit immediate
-      // No relation with Mips Lo register
-      Lo,
+    // Get the Lower 16 bits from a 32/64-bit immediate
+    // No relation with Mips Lo register
+    Lo,
 
-      // Get the High 16 bits from a 32 bit immediate for accessing the GOT.
-      GotHi,
+    // Get the High 16 bits from a 32 bit immediate for accessing the GOT.
+    GotHi,
 
-      // Get the High 16 bits from a 32-bit immediate for accessing TLS.
-      TlsHi,
+    // Get the High 16 bits from a 32-bit immediate for accessing TLS.
+    TlsHi,
 
-      // Handle gp_rel (small data/bss sections) relocation.
-      GPRel,
+    // Handle gp_rel (small data/bss sections) relocation.
+    GPRel,
 
-      // Thread Pointer
-      ThreadPointer,
-
-      // Vector Floating Point Multiply and Subtract
-      FMS,
-
-      // Floating Point Branch Conditional
-      FPBrcond,
-
-      // Floating Point Compare
-      FPCmp,
-
-      // Floating point Abs
-      FAbs,
-
-      // Floating point select
-      FSELECT,
-
-      // Node used to generate an MTC1 i32 to f64 instruction
-      MTC1_D64,
-
-      // Floating Point Conditional Moves
-      CMovFP_T,
-      CMovFP_F,
-
-      // FP-to-int truncation node.
-      TruncIntFP,
-
-      // Return
-      Ret,
-
-      // Interrupt, exception, error trap Return
-      ERet,
-
-      // Software Exception Return.
-      EH_RETURN,
-
-      // Node used to extract integer from accumulator.
-      MFHI,
-      MFLO,
-
-      // Node used to insert integers to accumulator.
-      MTLOHI,
-
-      // Mult nodes.
-      Mult,
-      Multu,
-
-      // MAdd/Sub nodes
-      MAdd,
-      MAddu,
-      MSub,
-      MSubu,
-
-      // DivRem(u)
-      DivRem,
-      DivRemU,
-      DivRem16,
-      DivRemU16,
-
-      BuildPairF64,
-      ExtractElementF64,
-
-      Wrapper,
-
-      DynAlloc,
-
-      Sync,
-
-      Ext,
-      Ins,
-      CIns,
-
-      // EXTR.W intrinsic nodes.
-      EXTP,
-      EXTPDP,
-      EXTR_S_H,
-      EXTR_W,
-      EXTR_R_W,
-      EXTR_RS_W,
-      SHILO,
-      MTHLIP,
-
-      // DPA.W intrinsic nodes.
-      MULSAQ_S_W_PH,
-      MAQ_S_W_PHL,
-      MAQ_S_W_PHR,
-      MAQ_SA_W_PHL,
-      MAQ_SA_W_PHR,
-      DPAU_H_QBL,
-      DPAU_H_QBR,
-      DPSU_H_QBL,
-      DPSU_H_QBR,
-      DPAQ_S_W_PH,
-      DPSQ_S_W_PH,
-      DPAQ_SA_L_W,
-      DPSQ_SA_L_W,
-      DPA_W_PH,
-      DPS_W_PH,
-      DPAQX_S_W_PH,
-      DPAQX_SA_W_PH,
-      DPAX_W_PH,
-      DPSX_W_PH,
-      DPSQX_S_W_PH,
-      DPSQX_SA_W_PH,
-      MULSA_W_PH,
-
-      MULT,
-      MULTU,
-      MADD_DSP,
-      MADDU_DSP,
-      MSUB_DSP,
-      MSUBU_DSP,
-
-      // DSP shift nodes.
-      SHLL_DSP,
-      SHRA_DSP,
-      SHRL_DSP,
-
-      // DSP setcc and select_cc nodes.
-      SETCC_DSP,
-      SELECT_CC_DSP,
-
-      // Vector comparisons.
-      // These take a vector and return a boolean.
-      VALL_ZERO,
-      VANY_ZERO,
-      VALL_NONZERO,
-      VANY_NONZERO,
-
-      // These take a vector and return a vector bitmask.
-      VCEQ,
-      VCLE_S,
-      VCLE_U,
-      VCLT_S,
-      VCLT_U,
-
-      // Vector Shuffle with mask as an operand
-      VSHF,  // Generic shuffle
-      SHF,   // 4-element set shuffle.
-      ILVEV, // Interleave even elements
-      ILVOD, // Interleave odd elements
-      ILVL,  // Interleave left elements
-      ILVR,  // Interleave right elements
-      PCKEV, // Pack even elements
-      PCKOD, // Pack odd elements
-
-      // Vector Lane Copy
-      INSVE, // Copy element from one vector to another
-
-      // Combined (XOR (OR $a, $b), -1)
-      VNOR,
-
-      // Extended vector element extraction
-      VEXTRACT_SEXT_ELT,
-      VEXTRACT_ZEXT_ELT,
-
-      // Double select nodes for machines without conditional-move.
-      DOUBLE_SELECT_I,
-      DOUBLE_SELECT_I64,
-
-      // Load/Store Left/Right nodes.
-      LWL,
-      LWR,
-      SWL,
-      SWR,
-      LDL,
-      LDR,
-      SDL,
-      SDR
-    };
+    // Thread Pointer
+    ThreadPointer,
+
+    // Vector Floating Point Multiply and Subtract
+    FMS,
+
+    // Floating Point Branch Conditional
+    FPBrcond,
+
+    // Floating Point Compare
+    FPCmp,
+
+    // Floating point Abs
+    FAbs,
+
+    // Floating point select
+    FSELECT,
+
+    // Node used to generate an MTC1 i32 to f64 instruction
+    MTC1_D64,
+
+    // Floating Point Conditional Moves
+    CMovFP_T,
+    CMovFP_F,
+
+    // FP-to-int truncation node.
+    TruncIntFP,
+
+    // Return
+    Ret,
+
+    // Interrupt, exception, error trap Return
+    ERet,
+
+    // Software Exception Return.
+    EH_RETURN,
+
+    // Node used to extract integer from accumulator.
+    MFHI,
+    MFLO,
+
+    // Node used to insert integers to accumulator.
+    MTLOHI,
+
+    // Mult nodes.
+    Mult,
+    Multu,
+
+    // MAdd/Sub nodes
+    MAdd,
+    MAddu,
+    MSub,
+    MSubu,
+
+    // DivRem(u)
+    DivRem,
+    DivRemU,
+    DivRem16,
+    DivRemU16,
+
+    BuildPairF64,
+    ExtractElementF64,
+
+    Wrapper,
+
+    DynAlloc,
+
+    Sync,
+
+    Ext,
+    Ins,
+    CIns,
+
+    // EXTR.W intrinsic nodes.
+    EXTP,
+    EXTPDP,
+    EXTR_S_H,
+    EXTR_W,
+    EXTR_R_W,
+    EXTR_RS_W,
+    SHILO,
+    MTHLIP,
+
+    // DPA.W intrinsic nodes.
+    MULSAQ_S_W_PH,
+    MAQ_S_W_PHL,
+    MAQ_S_W_PHR,
+    MAQ_SA_W_PHL,
+    MAQ_SA_W_PHR,
+    DPAU_H_QBL,
+    DPAU_H_QBR,
+    DPSU_H_QBL,
+    DPSU_H_QBR,
+    DPAQ_S_W_PH,
+    DPSQ_S_W_PH,
+    DPAQ_SA_L_W,
+    DPSQ_SA_L_W,
+    DPA_W_PH,
+    DPS_W_PH,
+    DPAQX_S_W_PH,
+    DPAQX_SA_W_PH,
+    DPAX_W_PH,
+    DPSX_W_PH,
+    DPSQX_S_W_PH,
+    DPSQX_SA_W_PH,
+    MULSA_W_PH,
+
+    MULT,
+    MULTU,
+    MADD_DSP,
+    MADDU_DSP,
+    MSUB_DSP,
+    MSUBU_DSP,
+
+    // DSP shift nodes.
+    SHLL_DSP,
+    SHRA_DSP,
+    SHRL_DSP,
+
+    // DSP setcc and select_cc nodes.
+    SETCC_DSP,
+    SELECT_CC_DSP,
+
+    // Vector comparisons.
+    // These take a vector and return a boolean.
+    VALL_ZERO,
+    VANY_ZERO,
+    VALL_NONZERO,
+    VANY_NONZERO,
+
+    // These take a vector and return a vector bitmask.
+    VCEQ,
+    VCLE_S,
+    VCLE_U,
+    VCLT_S,
+    VCLT_U,
+
+    // Vector Shuffle with mask as an operand
+    VSHF,  // Generic shuffle
+    SHF,   // 4-element set shuffle.
+    ILVEV, // Interleave even elements
+    ILVOD, // Interleave odd elements
+    ILVL,  // Interleave left elements
+    ILVR,  // Interleave right elements
+    PCKEV, // Pack even elements
+    PCKOD, // Pack odd elements
+
+    // Vector Lane Copy
+    INSVE, // Copy element from one vector to another
+
+    // Combined (XOR (OR $a, $b), -1)
+    VNOR,
+
+    // Extended vector element extraction
+    VEXTRACT_SEXT_ELT,
+    VEXTRACT_ZEXT_ELT,
+
+    // Double select nodes for machines without conditional-move.
+    DOUBLE_SELECT_I,
+    DOUBLE_SELECT_I64,
+
+    // Load/Store Left/Right nodes.
+    LWL,
+    LWR,
+    SWL,
+    SWR,
+    LDL,
+    LDR,
+    SDL,
+    SDR
+  };
 
   } // ene namespace MipsISD
 
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.h b/llvm/lib/Target/SystemZ/SystemZISelLowering.h
index 4f418eceef..cc29e3b7d9 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.h
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.h
@@ -98,7 +98,12 @@ enum NodeType : unsigned {
   // Add/subtract with overflow/carry.  These have the same operands as
   // the corresponding standard operations, except with the carry flag
   // replaced by a condition code value.
-  SADDO, SSUBO, UADDO, USUBO, ADDCARRY, SUBCARRY,
+  SADDO,
+  SSUBO,
+  UADDO,
+  USUBO,
+  ADDCARRY,
+  SUBCARRY,
 
   // Set the condition code from a boolean value in operand 0.
   // Operand 1 is a mask of all condition-code values that may result of this
@@ -228,11 +233,14 @@ enum NodeType : unsigned {
   VSUM,
 
   // Compute carry/borrow indication for add/subtract.
-  VACC, VSCBI,
+  VACC,
+  VSCBI,
   // Add/subtract with carry/borrow.
-  VAC, VSBI,
+  VAC,
+  VSBI,
   // Compute carry/borrow indication for add/subtract with carry/borrow.
-  VACCC, VSBCBI,
+  VACCC,
+  VSBCBI,
 
   // Compare integer vector operands 0 and 1 to produce the usual 0/-1
   // vector result.  VICMPE is for equality, VICMPH for "signed greater than"
@@ -374,10 +382,12 @@ enum NodeType : unsigned {
   ATOMIC_CMP_SWAP_128,
 
   // Byte swapping load/store.  Same operands as regular load/store.
-  LRV, STRV,
+  LRV,
+  STRV,
 
   // Element swapping load/store.  Same operands as regular load/store.
-  VLER, VSTER,
+  VLER,
+  VSTER,
 
   // Use STORE CLOCK FAST to store current TOD clock value.
   STCKF,

``````````

</details>


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


More information about the llvm-commits mailing list