[llvm] [AArch64] Transform lsr + cbz/cbnz into cmp + bcc in loops (PR #228005)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 02:22:53 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/AArch64/AArch64CondBrTuning.cpp llvm/lib/Target/AArch64/AArch64InstrInfo.cpp llvm/lib/Target/AArch64/AArch64InstrInfo.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/AArch64/AArch64CondBrTuning.cpp b/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
index 07dc10412..ebe6e8f16 100644
--- a/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
+++ b/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
@@ -23,7 +23,8 @@
 /// 3) sub w8, w0, w1       -> subs w8, w0, w1   ; w8 has multiple uses.
 ///    tbz w8, #31, .LBB6_2 -> b.pl .LBB6_2
 ///
-/// 4) lsr x8, x0, 32    ->  mov	w9, #4294967296   ; will be hoisted later
+/// 4) lsr x8, x0, 32    ->  mov	w9, #4294967296   ; will be hoisted
+/// later
 ///    cbz x8, .LBB0_0   ->  cmp	x8, x9            ; fused with bcc
 ///                      ->  b.lo .LBB0_0
 ///

``````````

</details>


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


More information about the llvm-commits mailing list