[llvm] [Mips] Add lowerConstantFP to optimize some floating load instrs to mtc1+mthc1 (PR #196226)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 02:32:21 PDT 2026


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 origin/main HEAD --extensions h,cpp -- llvm/lib/Target/Mips/MipsISelLowering.cpp llvm/lib/Target/Mips/MipsISelLowering.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 1ac9ca19e..aa3e0bc5a 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -2131,7 +2131,8 @@ SDValue MipsTargetLowering::lowerConstantFP(SDValue Op,
 
     // TODO: DAG.getConstant(0) should be optimized to avoid generate an extra
     // instr `addiu $x, $zero, 0`.
-    SDValue Low = DAG.getCopyFromReg(DAG.getEntryNode(), DL, Mips::ZERO, MVT::i32);
+    SDValue Low =
+        DAG.getCopyFromReg(DAG.getEntryNode(), DL, Mips::ZERO, MVT::i32);
     SDValue Hi = DAG.getConstant(INTVal.extractBits(32, 32), DL, MVT::i32);
     return DAG.getNode(MipsISD::BuildPairF64, DL, MVT::f64, Low, Hi);
   }

``````````

</details>


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


More information about the llvm-commits mailing list