Henry Shackleton
Henry Shackleton

Reputation: 391

How to use GCC Profile Guided Optimization with large Makefile?

I'm trying to figure out PGO with GCC, but all the examples I can find online just feature a single .c file where the compilation is quite straightforward. Are there any resources that talk about how this is meant to work for larger projects where multiple .o files are being compiled and linked together? Like, do I just toss in an -fprofile-generate and -fprofile-use flags like normal? Since if so, the resulting .gcda files get distributed across multiple directories, and I can't tell if -fprofile-use is picking up on them. Should I export everything into a single benchmarking folder?

For context, I have tried both these things and have not had any luck speeding up my current code. But I can't tell whether I'm doing something incorrectly, or if my code just isn't really optimizable with PGO.

Upvotes: 3

Views: 255

Answers (0)

Related Questions