[all-commits] [llvm/llvm-project] cbd89f: [AArch64] Form CCMP for CBB and CBH
David Tellenbach via All-commits
all-commits at lists.llvm.org
Thu Sep 10 19:19:21 PDT 2026
Branch: refs/heads/users/dtellenbach/cmpbr_ccmp2/ccmp_for_cbb_cbh
Home: https://github.com/llvm/llvm-project
Commit: cbd89f8405a400ee5f892832f72f2d8a08fcd75a
https://github.com/llvm/llvm-project/commit/cbd89f8405a400ee5f892832f72f2d8a08fcd75a
Author: David Tellenbach <dtellenbach at apple.com>
Date: 2026-09-10 (Thu, 10 Sep 2026)
Changed paths:
M llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
M llvm/test/CodeGen/AArch64/cmpbr-ccmp.ll
M llvm/test/CodeGen/AArch64/cmpbr-ccmp.mir
Log Message:
-----------
[AArch64] Form CCMP for CBB and CBH
AArch64ConditionalCompares forms CMP/CCMP chains to transform patterns
such as
Head Head
/ | CmpBB
/ | / |
| CmpBB => / |
| / | Tail |
| / | | |
Tail | | |
| | | |
... ... ... ...
where Head is terminated by a conditional branch and CmpBB contains
a cmp + conditional branch.
We usually try to split any fused conditional branches to be able to
form CCMP. However, in the case of CBB and CBH, splitting the fused
conditional branch in CmpBB could require the insertion of explicit
zero- or sign-extensions for both operands. In the Head block we can
cheaply fuse at least one of the extensions into cmp.
We therefore convert CBB and CBH unconditionally when we find them in
the Head block. In the CmpBB block, we only do the transformation if
neither operands needs an extension.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list