From: Andrew Pinski Date: Fri, 15 May 2026 08:12:15 +0000 (-0700) Subject: ssa_operands: speed up GIMPLE_SWITCH handling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c8f688fd8d936859dda5cd2eea88f0b22b6c189;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/tree-ssa-operands.cc b/gcc/tree-ssa-operands.cc index f9e347e8dbc..4c5c4ee8db9 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 (stmt)), + opf_use); + break; + case GIMPLE_CALL: /* Add call-clobbered operands, if needed. */ maybe_add_call_vops (as_a (stmt));