Lines Matching refs:Clang

1 # Optimizing Clang : A Practical Example of Applying BOLT
12 programs can benefit too. Clang, one of the most popular open-source C/C++ compilers,
14 As we will see, the Clang binary suffers from many instruction cache
18 In this tutorial we will first build Clang with PGO and LTO, and then will show steps on how to
19 apply BOLT optimizations to make Clang up to 15% faster. We will also analyze where
23 ## Building Clang
25 The process of getting Clang sources and performing the build is very similar to the
27 on how to obtain and build Clang in [Bootstrapping Clang-7 with PGO and LTO](#bootstrapping-clang-7…
29 The only difference from the standard Clang build is that we require the `-Wl,-q` flag to be presen…
33 ## Optimizing Clang with BOLT
35 We will use the setup described in [Bootstrapping Clang-7 with PGO and LTO](#bootstrapping-clang-7-…
38 Before we can run BOLT optimizations, we need to collect the profile for Clang, and we will use
39 Clang/LLVM sources for that.
63 `clang` and `clang++` are symlinking to. The next step will optimize Clang using
105 `clang-7.bolt` can be used as a replacement for *PGO+LTO* Clang:
110 Doing a new build of Clang using the new binary shows a significant overall
123 If we run BOLT on a Clang binary compiled without *PGO+LTO* (in which case the build is finished in…
129 We mentioned that Clang suffers from considerable instruction cache misses. This can be measured wi…
153 ## Using Clang for Other Applications
155 We have collected profile for Clang using its own source code. Would it be enough to speed up
158 … Haswell system using the *PGO+LTO* Clang, the build finished in 136.06 seconds, while using the *…
159 That's a noticeable improvement, but not as significant as the one we saw on Clang itself.
161 Another reason is that Clang is run with a different set of options while building `mysqld` compared
167 …fdata` utility that comes with BOLT. Optimized with that profile, the *PGO+LTO+BOLT* Clang was able
168 …orm the `mysqld` build in 124.74 seconds, i.e. 11 seconds or 9% faster compared to *PGO+LGO* Clang.
169 …ed profile didn't make the original Clang compilation slower either, while the number of profiled …
176 performance of the Clang compiler. Similarly, BOLT could be used to improve the performance
183 ## Bootstrapping Clang-7 with PGO and LTO
185 Below we describe detailed steps to build Clang, and make it ready for BOLT
189 ### Getting Clang-7 Sources
203 default system compiler to build Clang. If your system lacks a compiler, use
224 Using the freshly-baked stage 1 Clang compiler, we are going to build Clang with
243 while building Clang itself:
257 passed back into Clang:
263 ### Building Clang with PGO and LTO
266 our scenario, i.e. building Clang. We will also enable link-time optimizations
287 Now we have a Clang compiler that can build itself much faster. As we will see,