On Tue, Jan 24, 2012 at 2:50 AM, Richard Guenther
> On Tue, Jan 24, 2012 at 7:34 AM, Andrew Pinski
> <andrew.pin...@caviumnetworks.com> wrote:
>> Right now PHI-OPT does try to handle the case where we have multiple
>> PHIs but the other PHIs have the same value for the edges we care
>> This fixes the issue and allows PHI-OPT to handle a few more cases and
>> it removes the TODO in the comments.
>> OK For 4.8? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>> Andrew Pinski
>> * tree-ssa-phiopt.c (gimple_phi_singleton_for_edges): New function.
> The name is confusing I think, because it returns the single non-singleton
> PHI for the edge pair ... you can avoid choosing a better name by
> inlining it to its single call site. I'd maybe name it
> Otherwise ok.
Here is the updated patch with one small change, value_replacement
uses single_non_singleton_phi_for_edges now too.
OK still? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
* tree-ssa-phiopt.c (single_non_singleton_phi_for_edges): New function.
(tree_ssa_phiopt_worker): Use single_non_singleton_phi_for_edges.
(empty_block_p): Check also if the PHIs for the block are empty.
* gcc.dg/tree-ssa/phi-opt-7.c: New testcase.
>> (tree_ssa_phiopt_worker): Use gimple_phi_singleton_for_edges.
>> (empty_block_p): Check also if the PHIs for the block are empty.
>> * gcc.dg/tree-ssa/phi-opt-7.c: New testcase.