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 <andrew.pinski@oss.qualcomm.com>
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));