On 6/15/2026 11:00 AM, Andrew Pinski wrote:
> This is a small improvement to the code where we allow factoring
> out loads even with stores (or calls) before hand, this will allow
> for store elimination (store factoring) to happen too.
> factor_op_phi-load-stores-1.c is one such example.
> Also adds the cost model to factoring out loads.
>
> Bootstrapped and tested on x86_64-linux-gnu.
>
> gcc/ChangeLog:
>
>       * tree-ssa-phiopt.cc (is_factor_profitable): Change arg_op
>       to operands and opcount.
>       (factor_out_conditional_operation): Update call to
>       is_factor_profitable.
>       (factor_out_conditional_load): Support when merge has
>       a virtual phi. The load's vuse needs to be the arguments
>       to the virtual phi. Call is_factor_profitable on the new phi
>       arguments. Update the vuse on the new load to the virtual phi.
>
> gcc/testsuite/ChangeLog:
>
>       * gcc.dg/tree-ssa/factor_op_phi-load-stores-1.c: New test.
>
> Signed-off-by: Andrew Pinski <[email protected]>
OK.  THanks!

jeff

Reply via email to