[PATCH] D28593: Update loop branch_weight metadata after loop rotation.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 14:59:58 PST 2017


danielcdh added a comment.

Talked with Xin offline:

1. The comparison I made is (clean client v.s. entire patch), while Xin is comparing (https://reviews.llvm.org/D28460 v.s. entire patch)
2. We both agree that the patch works fine for cases when avg trip count >= 0.5
3. For cases when avg trip count <0.5 3.1 both have good code layout, the set probability for the guard branch are both reasonable 3.2 this patch will peel the loop by 1, while no_patch will not peel the loop, so the patch has code size overhead 3.3 the peeled loop may have better performance on the cold path when the loop trip count is unevenly distributed (but I started to doubt this now)
4. If 3.3 is true, then the problem becomes whether we want to trade code size for performance at cold path. Xin is going to run some benchmarks with and without the test to measure code size and performance impact of this patch and report back.


https://reviews.llvm.org/D28593





More information about the llvm-commits mailing list