[llvm] [llvm-profgen] Improve sample profile density (PR #92144)

Lei Wang via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 12:27:07 PDT 2024


wlei-llvm wrote:

>Though if we decided to compute density after pre-inline, it might make more sense to include inlinees directly? But yes, data will tell us which one is better. If they are similar, then we can aim for implementation simplicity.

Yeah, makes sense, updated to use the binary-level density. 

> Can you share some date to show that 20 is a good threshold?

Shared more detailed data with you internally, just summarized here for reference. 

Service1:

| total_samples | Perf  | Density |
|---------------|-------|---------|
| 2.5M          | +0.35 | 30.29   |
| 1.2M          | +0.18 | 18.79   |
| 280K          | -1.22 | 7.97       |
| 200K          | -1.16 | 4.50       |

Service2:
| total_samples | Perf  | Density |
|---------------|-------|---------|
| 4.2M          | +0.22 | 23.80   |
| 1.2M          | +0.20 | 19.37   |
| 500K          | -0.15| 8.72       |
| 200K          | -0.97 | 2.71       |

Service3:
| total_samples | Perf  | Density |
|---------------|-------|---------|
| 700K          | +0.4 | 48.02   |
| 500K          | -0.4 | 37.95   |
| 100K          | -3 | 6.00       |
| 50K          | -10 | 7.02       |

Also working on other services, so far it seems the regression started when the density dropped below 10, so that' why set the threshold to 20(We can set to 50 if we want to be more conservative)

https://github.com/llvm/llvm-project/pull/92144


More information about the llvm-commits mailing list