From 9c18bdb07e299b25e7526fea16659c7ff8f0d14e Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Sat, 27 Apr 2024 18:54:44 -0700 Subject: MATCH: change single_non_singleton_phi_for_edges for singleton phis I noticed that single_non_singleton_phi_for_edges could return a phi whos entry are all the same for the edge. This happens only if there was a single phis in the first place. Also gimple_seq_singleton_p walks the sequence to see if it the one element in the sequence so there is removing that check actually reduces the number of pointer walks needed. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.cc (single_non_singleton_phi_for_edges): Remove the special case of gimple_seq_singleton_p. Signed-off-by: Andrew Pinski --- gcc/tree-ssa-phiopt.cc | 8 -------- 1 file changed, 8 deletions(-) (limited to 'gcc/tree-ssa-phiopt.cc') diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index d1746c4..f1e0750 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -62,14 +62,6 @@ single_non_singleton_phi_for_edges (gimple_seq seq, edge e0, edge e1) { gimple_stmt_iterator i; gphi *phi = NULL; - if (gimple_seq_singleton_p (seq)) - { - phi = as_a (gsi_stmt (gsi_start (seq))); - /* Never return virtual phis. */ - if (virtual_operand_p (gimple_phi_result (phi))) - return NULL; - return phi; - } for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i)) { gphi *p = as_a (gsi_stmt (i)); -- cgit v1.1