[llvm] [LegalizeDAG] Use Base+Offset instead of Offset+Base for jump tables (PR #125279)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:09:05 PST 2025


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 e822dff0e9285707ad964ba831cb861d2f6f1714 2a6b0ace28c68fd8c934b1b77d91838257f61cca --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/lib/Target/Mips/MipsISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 0efe3e994c..6c9c96ceaa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3981,7 +3981,8 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
       // For PIC, the sequence is:
       // BRIND(RelocBase + load(Jumptable + index))
       // RelocBase can be JumpTable, GOT or some sort of global base.
-      Addr = DAG.getMemBasePlusOffset(TLI.getPICJumpTableRelocBase(Table, DAG),                                      Addr, dl);
+      Addr = DAG.getMemBasePlusOffset(TLI.getPICJumpTableRelocBase(Table, DAG),
+                                      Addr, dl);
     }
 
     Tmp1 = TLI.expandIndirectJTBranch(dl, LD.getValue(1), Addr, JTI, DAG);
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 9e6f012f8e..099a3f7dbc 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -1149,7 +1149,6 @@ static SDValue performADDCombine(SDNode *N, SelectionDAG &DAG,
   if (InnerAdd.getOpcode() != ISD::ADD)
     return SDValue();
 
-
   SDValue Lo = InnerAdd.getOperand(0);
   SDValue Other = InnerAdd.getOperand(1);
   if (Lo.getOpcode() != MipsISD::Lo)

``````````

</details>


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


More information about the llvm-commits mailing list