[llvm] [LoongArch] Add initial MachineCombiner support (PR #230830)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 11:43:50 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 cpp,h -- llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp llvm/lib/Target/LoongArch/LoongArchInstrInfo.h llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp --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/LoongArch/LoongArchInstrInfo.cpp b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
index 7bfb0fd57..653e0ced8 100644
--- a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
@@ -516,7 +516,7 @@ bool LoongArchInstrInfo::isAssociativeAndCommutative(const MachineInstr &Inst,
   case LoongArch::XVFMUL_S:
   case LoongArch::XVFMUL_D:
     return Inst.getFlag(MachineInstr::MIFlag::FmReassoc) &&
-             Inst.getFlag(MachineInstr::MIFlag::FmNsz);
+           Inst.getFlag(MachineInstr::MIFlag::FmNsz);
   // IEEE 754-2008 minNum/maxNum: an sNaN operand yields qNaN, which breaks
   // associativity (min(min(3,sNaN),1) = 1 but min(3,min(sNaN,1)) = 3).
   // Signed zeros are ordered (-0 < +0) and the result is exact, so no

``````````

</details>


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


More information about the llvm-commits mailing list