From 4852c3266ec0887316b9fbbb106b8540e3e948d6 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 13 Nov 2020 11:33:22 +0100 Subject: remove almost all users of gimple_expr_code This replaces the old-school gimple_expr_code with more selective functions throughout the compiler, in all cases making the code shorter or more clear. 2020-11-13 Richard Biener * cfgexpand.c (gimple_assign_rhs_to_tree): Use gimple_assign_rhs_class. (expand_gimple_stmt_1): Likewise. * gimplify-me.c (gimple_regimplify_operands): Use gimple_assign_single_p. * ipa-icf-gimple.c (func_checker::compare_gimple_assign): Remove redundant compare. (func_checker::compare_gimple_cond): Use gimple_cond_code. * tree-ssa-tail-merge.c (gimple_equal_p): Likewise. * predict.c (predict_loops): Use gimple_assign_rhs_code. --- gcc/gimplify-me.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'gcc/gimplify-me.c') diff --git a/gcc/gimplify-me.c b/gcc/gimplify-me.c index 47148fb..ee84c8b 100644 --- a/gcc/gimplify-me.c +++ b/gcc/gimplify-me.c @@ -230,10 +230,8 @@ gimple_regimplify_operands (gimple *stmt, gimple_stmt_iterator *gsi_p) if (i == 1 && (is_gimple_call (stmt) || is_gimple_assign (stmt))) gimplify_expr (&op, &pre, NULL, is_gimple_lvalue, fb_lvalue); else if (i == 2 - && is_gimple_assign (stmt) - && num_ops == 2 - && get_gimple_rhs_class (gimple_expr_code (stmt)) - == GIMPLE_SINGLE_RHS) + && gimple_assign_single_p (stmt) + && num_ops == 2) gimplify_expr (&op, &pre, NULL, rhs_predicate_for (gimple_assign_lhs (stmt)), fb_rvalue); @@ -255,10 +253,8 @@ gimple_regimplify_operands (gimple *stmt, gimple_stmt_iterator *gsi_p) { bool need_temp = false; - if (is_gimple_assign (stmt) - && num_ops == 2 - && get_gimple_rhs_class (gimple_expr_code (stmt)) - == GIMPLE_SINGLE_RHS) + if (gimple_assign_single_p (stmt) + && num_ops == 2) gimplify_expr (gimple_assign_rhs1_ptr (stmt), &pre, NULL, rhs_predicate_for (gimple_assign_lhs (stmt)), fb_rvalue); -- cgit v1.1