[llvm] [Mips] Optimize `or (and $src1, mask0), (shl $src2, mask1)` to `ins` (PR #103017)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 20:09:12 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 ca26ea28ed10c7fd642bfbdf4f897a4362674460 0048edb8b6feef3680a1f45654632551aff68a3b --extensions cpp -- llvm/lib/Target/Mips/MipsISelLowering.cpp
``````````

</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 75848b66f6..b2efb63e4e 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -894,11 +894,11 @@ static SDValue performORCombine(SDNode *N, SelectionDAG &DAG,
     //   $dst = or (shl $src2, size0), (and $src1, (2**size0 - 1))
     //   ==> ins $src1, $src2, pos, size, pos = size0, size = 32 - pos;
     SDValue AndOperand0 = FirstOperand.getOpcode() == ISD::AND
-                             ? FirstOperand.getOperand(0)
-                             : SecondOperand.getOperand(0);
+                              ? FirstOperand.getOperand(0)
+                              : SecondOperand.getOperand(0);
     SDValue ShlOperand0 = FirstOperand.getOpcode() == ISD::AND
-                             ? SecondOperand.getOperand(0)
-                             : FirstOperand.getOperand(0);
+                              ? SecondOperand.getOperand(0)
+                              : FirstOperand.getOperand(0);
     SDValue AndMask = FirstOperand.getOpcode() == ISD::AND
                           ? FirstOperand.getOperand(1)
                           : SecondOperand.getOperand(1);

``````````

</details>


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


More information about the llvm-commits mailing list