https://gcc.gnu.org/g:8c8f688fd8d936859dda5cd2eea88f0b22b6c189

commit r17-538-g8c8f688fd8d936859dda5cd2eea88f0b22b6c189
Author: Andrew Pinski <[email protected]>
Date:   Fri May 15 01:12:15 2026 -0700

    ssa_operands: speed up GIMPLE_SWITCH handling
    
    The operands of a GIMPLE_SWITCH is index, followed by the cases.
    The cases are all CASE_LABEL_EXPR which are skipped via 
operands_scanner::get_expr_operands
    anyways so we only need to scan the index operand.
    This also the first step in changing GIMPLE_SWITCH slightly.
    
    gcc/ChangeLog:
    
            * tree-ssa-operands.cc (operands_scanner::parse_ssa_operands):
            Process index of the gswitch only.
    
    Signed-off-by: Andrew Pinski <[email protected]>

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

diff --git a/gcc/tree-ssa-operands.cc b/gcc/tree-ssa-operands.cc
index f9e347e8dbce..4c5c4ee8db92 100644
--- a/gcc/tree-ssa-operands.cc
+++ b/gcc/tree-ssa-operands.cc
@@ -976,6 +976,12 @@ operands_scanner::parse_ssa_operands ()
       append_vuse (gimple_vop (fn));
       goto do_default;
 
+    /* Switch index is the only operand that matters.  */
+    case GIMPLE_SWITCH:
+      get_expr_operands (gimple_switch_index_ptr (as_a <gswitch*> (stmt)),
+                        opf_use);
+      break;
+
     case GIMPLE_CALL:
       /* Add call-clobbered operands, if needed.  */
       maybe_add_call_vops (as_a <gcall *> (stmt));

Reply via email to