https://gcc.gnu.org/g:b392aaee73282c29d14507e4ee58ef048b34b783

commit r17-4065-gb392aaee73282c29d14507e4ee58ef048b34b783
Author: Kyrylo Tkachov <[email protected]>
Date:   Sun Sep 6 13:03:27 2026 +0200

    ifcvt: say what MAX_CONDITIONAL_EXECUTE limits
    
    The name reads as a conditional-execution limit, but the branchless paths 
use
    it too, as the number of instructions they may speculate: the diamond
    multiple-set gate in noce_process_if_block and the assignment count in
    check_cond_move_block both test it.  Say so where it is defined, and record
    that the default charges an unpredictable branch.  Comment-only.
    
    gcc/ChangeLog:
    
            * ifcvt.cc (MAX_CONDITIONAL_EXECUTE): Add a comment.
    
    Signed-off-by: Kyrylo Tkachov <[email protected]>

Diff:
---
 gcc/ifcvt.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
index a5f3454835ea..42fc5d13f620 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -47,6 +47,12 @@
 #include "rtl-iter.h"
 #include "ifcvt.h"
 
+/* The number of instructions this pass may make run unconditionally in place
+   of a branch.  The conditional-execution path uses it as the number of insns
+   it may predicate.  The branchless paths use it as the number of insns they
+   may speculate.  The default charges the cost of an unpredictable branch,
+   plus one.  Some targets override it.  */
+
 #ifndef MAX_CONDITIONAL_EXECUTE
 #define MAX_CONDITIONAL_EXECUTE \
   (BRANCH_COST (optimize_function_for_speed_p (cfun), false) \

Reply via email to