[PATCH] D19948: Propagate branch metadata when some branch probability is missing.

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 15:11:57 PDT 2016


spatel added a comment.

In http://reviews.llvm.org/D19948#424803, @danielcdh wrote:

> In http://reviews.llvm.org/D19948#424226, @spatel wrote:
>
> > For this patch, I'm wondering if we should be doing a one-off correction for a missing weight. Wouldn't it be better to fill in all of the missing info before we reach SimplifyCFG?
>
>
> In sample profiler, we only annotate weights if we have profile for the branch. Yes, we can filling in missing weights like we do here, but those weights seem useless to other optimizations and it will unnecessarily increase IR size. Additionally, for case like this, if we assume that two branches should both (or none) have weights, we probably better assert instead of checking with "&&" condition, otherwise we may lose optimization opportunity without being notified.


I'll defer to David or Hal's better judgment on this. I don't know what the correct solution is.


http://reviews.llvm.org/D19948





More information about the llvm-commits mailing list