[llvm] [AArch64][GISel] Signed comparison using CMN is safe when the subtraction is nsw (PR #150480)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 24 10:48:09 PDT 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 HEAD~1 HEAD --extensions cpp -- llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
index 61c1c84fb..1614d78ef 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -5160,7 +5160,7 @@ MachineInstr *AArch64InstructionSelector::tryFoldIntegerCompare(
   // cmn z, y
   if (isCMN(RHSDef, P, MRI))
     return emitCMN(LHS, RHSDef->getOperand(2), MIRBuilder);
-  
+
   // Same idea here, but with the LHS of the compare instead:
   // Given this:
   //
@@ -5179,7 +5179,6 @@ MachineInstr *AArch64InstructionSelector::tryFoldIntegerCompare(
     return emitCMN(LHSDef->getOperand(2), RHS, MIRBuilder);
   }
 
-
   // Given this:
   //
   // z = G_AND x, y

``````````

</details>


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


More information about the llvm-commits mailing list