[PATCH] D22696: [CodeGenPrep] Skip merging empty case blocks

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 09:38:23 PDT 2016


Can you share the details of the povray case?

David

On Tue, Oct 4, 2016 at 8:26 AM, Jun Bum Lim <junbuml at codeaurora.org> wrote:
> junbuml added a comment.
>
>> On second thought, considering the cost of a direct branch, it is probably better to set the default frequency ratio to be >=2 . Also the check of number of phis should >probably a 'OR' instead of 'AND'. The default value of MinNumPhiInDestToSkipMerge should be 2:
>> if (Freq(Pred) >= FreqRatio*Freq(BB) || NumCopyInsertionPHIs > MinNumPhis)
>>
>>   return true;
>
> Thanks David for the review. I ran spec2000/2006 with the change you suggested. Most of the score changes seems to be noise, but I can see -2% reproducible regression in spec2006/povray when we are aggressive in this (i.e., the default frequency ratio to be >=2). I can see more I-cache miss with "FreqRatio=2" in spec2006/povray. It seems that it skips merging empty cases even for a switch with small number of cases  and the cost of branch is non-trivial especially when it mess up the I-cache.
>
> I think we need to be more conservative for the frequency ratio so that we skip merging only when we are sure that the empty case is less frequently executed.
>
>
> https://reviews.llvm.org/D22696
>
>
>


More information about the llvm-commits mailing list