[flang-commits] [clang] [flang] [llvm] [flang][cmake][perf-training] Optimize flang with PGO and BOLT (PR #198863)

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Mon Jun 15 07:47:25 PDT 2026


================
@@ -145,8 +161,18 @@ that also enables ThinLTO, use the following command:
       -DPGO_INSTRUMENT_LTO=Thin \
       <path to source>/llvm
 
-By default, clang will generate profile data by compiling a simple
-hello world program.  You can also tell clang to use an external
+Similarly, to build optimized Flang (along with Clang), you can use the
+following command:
+
+.. code-block:: console
+
+  $ cmake -G Ninja -C <path to source>/flang/cmake/caches/PGO.cmake \
+      -DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt;libunwind;openmp" \
+      -DPGO_INSTRUMENT_LTO=Thin \
+      <path to source>/llvm
----------------
Meinersbur wrote:

Is duplicating this just to mention the same thing but with `-DPGO_INSTRUMENT_LTO=Thin` (or the other options below) really worth blowing up the docs?

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


More information about the flang-commits mailing list