[llvm] [AArch64] Prefer tst + bcc over lsr + cbz/cbnz (PR #228005)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 13:46:54 PDT 2026


================
@@ -12252,6 +12252,33 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const {
     }
   }
 
+  // Transform (BR_CC eq/ne, (SRL val, imm), 0) to TST + BRCOND when those
+  // instructions can be fused.
+  if (Subtarget->hasCmpBccFusion()) {
----------------
efriedma-quic wrote:

Do we also need to check for hasArithmeticBccFusion()?

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


More information about the llvm-commits mailing list