[PATCH] D53598: Add docs+a script for building clang/LLVM with PGO
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 25 07:58:19 PDT 2018
hans added a comment.
I didn't have time to look at the script yet, but I read through the instructions doc. For most users I think maybe that's also the most important part, because I think many folks build quite differently. I will try to get to reading the script tomorrow.
================
Comment at: docs/HowToBuildWithPGO.rst:41
+The script mentioned above will simply build a release Clang/LLVM for the host
+architecture and run the Clang/LLVM test suites. This should give:
+
----------------
Maybe s/test suites/lit tests/? Because I assume it's not building test-suite?
================
Comment at: docs/HowToBuildWithPGO.rst:43
+
+- solid coverage of building C++,
+- good coverage of building C,
----------------
Including solid coverage for emitting all kinds of C++ diagnostics, whereas in many user builds none would be emitted. This is just a nit-pick, I'm not sure if there's a better way, but that might be one downside of using these kinds of tests for training.
================
Comment at: docs/HowToBuildWithPGO.rst:69
+3. Build your "benchmark" (detailed above) with the second Clang that you built
+4. Generate a profile from the benchmark runs
+5. Build a final release Clang (along with whatever other binaries you need)
----------------
3 and 4 kind of go together? I guess the outputs have to be merged, but the profile really is built while running the benchmarks, or that's how I think about it.
================
Comment at: docs/HowToBuildWithPGO.rst:71
+5. Build a final release Clang (along with whatever other binaries you need)
+ with the profile collected from your benchmark.
+
----------------
nit: s/with/using/ maybe?
================
Comment at: docs/HowToBuildWithPGO.rst:80
+2. Configure a Clang build as above, but add the following CMake args:
+ - ``-DLLVM_BUILD_INSTRUMENTED=IR`` -- This causes us to build everything
+ with instrumentation
----------------
Cool! I didn't know about this one.
================
Comment at: docs/HowToBuildWithPGO.rst:92
+3. Build your benchmark using the Clang generated in step 2. The 'standard'
+ benchmark recommended is to build Clang. So, create yet another build
+ directory, with the following CMake arguments
----------------
But the text says its running the test suite instead?
================
Comment at: docs/HowToBuildWithPGO.rst:110
+ path/to/stage2/profiles/*.profdata``.
+5. Now, build your final, freshly-optimized Clang. To do this, you'll want to
+ pass the following additional arguments to CMake.
----------------
instead of freshly-optimized, maybe say PGO-optimized or something similar to help distinguish the different kinds of clang getting built
https://reviews.llvm.org/D53598
More information about the llvm-commits
mailing list