diff mbox series

phiopt: Remove candorest variable return instead

Message ID 20241010152257.3309752-1-quic_apinski@quicinc.com
State New
Headers show
Series phiopt: Remove candorest variable return instead | expand

Commit Message

Andrew Pinski Oct. 10, 2024, 3:22 p.m. UTC
After r15-3560-gb081e6c860eb9688d24365d39, the setting of candorest
with the break can just change to a return since this is inside a lambda now.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

	* tree-ssa-phiopt.cc (pass_phiopt::execute): Remove candorest
	and return instead of setting candorest.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/tree-ssa-phiopt.cc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Richard Biener Oct. 10, 2024, 3:29 p.m. UTC | #1
> Am 10.10.2024 um 17:23 schrieb Andrew Pinski <quic_apinski@quicinc.com>:
> 
> After r15-3560-gb081e6c860eb9688d24365d39, the setting of candorest
> with the break can just change to a return since this is inside a lambda now.
> 
> Bootstrapped and tested on x86_64-linux-gnu.

Ok

Richard 

> gcc/ChangeLog:
> 
>    * tree-ssa-phiopt.cc (pass_phiopt::execute): Remove candorest
>    and return instead of setting candorest.
> 
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
> gcc/tree-ssa-phiopt.cc | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
> index 43b65b362a3..f3ee3a80c0f 100644
> --- a/gcc/tree-ssa-phiopt.cc
> +++ b/gcc/tree-ssa-phiopt.cc
> @@ -4322,7 +4322,6 @@ pass_phiopt::execute (function *)
>    }
> 
>       gimple_stmt_iterator gsi;
> -      bool candorest = true;
> 
>       /* Check that we're looking for nested phis.  */
>       basic_block merge = diamond_p ? EDGE_SUCC (bb2, 0)->dest : bb2;
> @@ -4338,15 +4337,11 @@ pass_phiopt::execute (function *)
>        tree arg1 = gimple_phi_arg_def (phi, e2->dest_idx);
>        if (value_replacement (bb, bb1, e1, e2, phi, arg0, arg1) == 2)
>          {
> -        candorest = false;
>        cfgchanged = true;
> -        break;
> +        return;
>          }
>      }
> 
> -      if (!candorest)
> -    return;
> -
>       gphi *phi = single_non_singleton_phi_for_edges (phis, e1, e2);
>       if (!phi)
>    return;
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 43b65b362a3..f3ee3a80c0f 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -4322,7 +4322,6 @@  pass_phiopt::execute (function *)
 	}
 
       gimple_stmt_iterator gsi;
-      bool candorest = true;
 
       /* Check that we're looking for nested phis.  */
       basic_block merge = diamond_p ? EDGE_SUCC (bb2, 0)->dest : bb2;
@@ -4338,15 +4337,11 @@  pass_phiopt::execute (function *)
 	    tree arg1 = gimple_phi_arg_def (phi, e2->dest_idx);
 	    if (value_replacement (bb, bb1, e1, e2, phi, arg0, arg1) == 2)
 	      {
-		candorest = false;
 		cfgchanged = true;
-		break;
+		return;
 	      }
 	  }
 
-      if (!candorest)
-	return;
-
       gphi *phi = single_non_singleton_phi_for_edges (phis, e1, e2);
       if (!phi)
 	return;