On Thu, 2019-12-05 at 11:12 +0100, Jan Hubicka wrote:
> Hi,
> this patch makes tree-ssa-threadupdate to not leave basic blocks with
> undefined counts in the program.  
> 
> create_block_for_threading sets counts as follows:
> 
>   /* Zero out the profile, since the block is unreachable for
> now.  */
>   rd->dup_blocks[count]->count = profile_count::uninitialized ();
> 
> which is usually set to correct count in update_profile. However
> template_blocks are not seen by it and thus this patch calculates the
> profile while redirecting edgs to it.
> 
> Bootstrapped/regtested x86_64-linux and also checked that the profile
> is
> correct. Does it make sense?  There is no testcase since I plan to
> commit sanity check that triggers several times during the testsuite
> and
> bootstrap w/o this patch.

I would have expected a call to update_profile even in the case of the
template block.

ISTM we would call ssa_fixup_template_block, which in turn would call
ssa_fix_duplicate_block_edges which in turn would have called
update_profile.

jeff

Reply via email to