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

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 20:18:20 PDT 2016


On Tue, Oct 4, 2016 at 2:47 PM, Jun Bum Lim <junbuml at codeaurora.org> wrote:
> junbuml added a comment.
>
> - In PGO I can see just noise level regression (-0.5%) with this patch with FreqRatio=2.
> - In Evaluate_TPat(), I can see 10 empty case blocks were applied in this patch, resulting in 10 more branches in the final assembly in aarch64 with -mcpu=kryo.

Does it also enable more machine code sinking? If not, perhaps the
heuristics to count copy insertion phis can be improved?

> Since SimplifyCFG also merge empty blocks in TryToSimplifyUncondBranchFromEmptyBlock(), making a simple case hit in CGP  require quite complex testcase. That's why I removed my first testcase in Diff1 (aarch64-skip-merging-case-block.ll). Please let me know if you really need a reduce testcase.
> - As of now, in this patch I believe we need to keep the default FreqRatio conservative, so I want to set it 1000, which I believe conservative enough.
>

How do you come up with 1000? It seems like specially tuned for that
benchmark where the switch top is in a loop while the switch body is
not -- the patch basically will never kick in for any switch in normal
form without profile.

David


>
> https://reviews.llvm.org/D22696
>
>
>


More information about the llvm-commits mailing list