[llvm] [MIPS] Fix miscompiles consecutive half operations (PR #110199)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 19:44:38 PDT 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 9b5a3036adbd9eed0f377cdf06aa622b917a1699 2ffa43edc3b4ada75d120ad9a4a9d31d32dd1326 --extensions h -- llvm/lib/Target/Mips/MipsISelLowering.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 1e35e87b6f..0e574ac644 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.h
+++ b/llvm/lib/Target/Mips/MipsISelLowering.h
@@ -375,26 +375,26 @@ class TargetRegisterClass;
 
    bool softPromoteHalfType() const override { return true; }
 
-  protected:
-    SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const;
+ protected:
+   SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const;
 
-    // This method creates the following nodes, which are necessary for
-    // computing a local symbol's address:
-    //
-    // (add (load (wrapper $gp, %got(sym)), %lo(sym))
-    template <class NodeTy>
-    SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG,
-                         bool IsN32OrN64) const {
-      unsigned GOTFlag = IsN32OrN64 ? MipsII::MO_GOT_PAGE : MipsII::MO_GOT;
-      SDValue GOT = DAG.getNode(MipsISD::Wrapper, DL, Ty, getGlobalReg(DAG, Ty),
-                                getTargetNode(N, Ty, DAG, GOTFlag));
-      SDValue Load =
-          DAG.getLoad(Ty, DL, DAG.getEntryNode(), GOT,
-                      MachinePointerInfo::getGOT(DAG.getMachineFunction()));
-      unsigned LoFlag = IsN32OrN64 ? MipsII::MO_GOT_OFST : MipsII::MO_ABS_LO;
-      SDValue Lo = DAG.getNode(MipsISD::Lo, DL, Ty,
-                               getTargetNode(N, Ty, DAG, LoFlag));
-      return DAG.getNode(ISD::ADD, DL, Ty, Load, Lo);
+   // This method creates the following nodes, which are necessary for
+   // computing a local symbol's address:
+   //
+   // (add (load (wrapper $gp, %got(sym)), %lo(sym))
+   template <class NodeTy>
+   SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG,
+                        bool IsN32OrN64) const {
+     unsigned GOTFlag = IsN32OrN64 ? MipsII::MO_GOT_PAGE : MipsII::MO_GOT;
+     SDValue GOT = DAG.getNode(MipsISD::Wrapper, DL, Ty, getGlobalReg(DAG, Ty),
+                               getTargetNode(N, Ty, DAG, GOTFlag));
+     SDValue Load =
+         DAG.getLoad(Ty, DL, DAG.getEntryNode(), GOT,
+                     MachinePointerInfo::getGOT(DAG.getMachineFunction()));
+     unsigned LoFlag = IsN32OrN64 ? MipsII::MO_GOT_OFST : MipsII::MO_ABS_LO;
+     SDValue Lo =
+         DAG.getNode(MipsISD::Lo, DL, Ty, getTargetNode(N, Ty, DAG, LoFlag));
+     return DAG.getNode(ISD::ADD, DL, Ty, Load, Lo);
     }
 
     // This method creates the following nodes, which are necessary for

``````````

</details>


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


More information about the llvm-commits mailing list