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

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 10:34:24 PDT 2016


danielcdh added a comment.

In http://reviews.llvm.org/D19948#424226, @spatel wrote:

> I changed http://reviews.llvm.org/D19674 in order to avoid the msan bot failure; it seems unnecessarily ugly to me, but it's passing on that bot now. There's still an Apple internal bot issue that seems to be triggered by http://reviews.llvm.org/rL268767 , so it may need some other change.
>
> 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.


http://reviews.llvm.org/D19948





More information about the llvm-commits mailing list