Hi all,

Export phi-opt's factoring helpers so the sink pass (in the following patch)
can reuse them to if-convert data-dependent load diamonds.
factor_out_conditional_operation is made non-static, and a new
factor_out_conditional_load turns a diamond PHI <*P, *Q> that selects between
two loads at data-dependent addresses into a single selected-pointer load.
factor_out_conditional_load checks the MEM_REF operand-1 types with
alias_ptr_types_compatible_p so loads with incompatible TBAA are never commoned.

Bootstrapped and tested on aarch64-none-linux-gnu.
Ok for trunk?

Thanks,
Kyrill

Signed-off-by: Kyrylo Tkachov <[email protected]>

        PR tree-optimization/125557
        * tree-ssa-phiopt.h (factor_out_conditional_load): Declare.
        (factor_out_conditional_operation): Declare.
        * tree-ssa-phiopt.cc: Include "alias.h".
        (remove_factored_arm_defs): New.
        (factor_out_conditional_load): New.
        (factor_out_conditional_operation): Remove static.

Attachment: 0001-1-2-PR-tree-optimization-125557-phiopt-export-load-o.patch
Description: 0001-1-2-PR-tree-optimization-125557-phiopt-export-load-o.patch

Reply via email to