[llvm] [AArch64] Sub, add, and icmp should have the fact they can be negated in the cost (PR #142844)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 13:32:48 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/AArch64TargetTransformInfo.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index 4a646df7c..0ad697d27 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -492,7 +492,7 @@ InstructionCost AArch64TTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
         Opcode == Instruction::ICmp) {
       // Add/Sub/ICmp immediates can be flipped.
       if (isLegalCmpImmed(Imm))
-          return TTI::TCC_Free;
+        return TTI::TCC_Free;
       Cost = AArch64TTIImpl::getIntImmCost(Imm.abs(), Ty, CostKind);
     } else
       Cost = AArch64TTIImpl::getIntImmCost(Imm, Ty, CostKind);

``````````

</details>


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


More information about the llvm-commits mailing list