[llvm] [AArch64] Fold CSET + BR_CC into a conditional branch (PR #207398)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 05:25:40 PDT 2026


================
@@ -11725,6 +11725,24 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const {
                        Overflow);
   }
 
+  // Fold CSET + BR_CC to a conditional branch (rather than keeping the CSET
+  // and emitting a TB[N]Z below).
+  {
+    using namespace llvm::SDPatternMatch;
+    SDValue Flags;
+    uint64_t InvCC;
----------------
MacDue wrote:

It stands for inverse. It's inverse as CSET is not an instruction. `CSET <Wd>, <cond>` is an alias for `CSINC <Wd>, WZR, WZR, invert(<cond>)`. So the "set" condition is inverse. 

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


More information about the llvm-commits mailing list