-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-130090: Support PGO for clang-cl #129907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
859c89f
a529c39
26fb51f
6e2cb69
7b46aeb
ced66bd
1aae65d
52fd5ab
c2ecb57
ad72df5
74ec74e
79ce418
8c8aa79
2a9da27
ea4de96
3346b9d
9db1a29
4ad2365
1977953
ad2dfce
6edbe07
81b4c1d
263870d
db208ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,14 +56,14 @@ Building Python using Clang/LLVM | |
-------------------------------- | ||
|
||
See https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170 | ||
how to install and use clang-cl bundled with Microsoft Visual Studio. | ||
for how to install and use clang-cl bundled with Microsoft Visual Studio. | ||
You can use the IDE to switch to clang-cl for local development, | ||
but because this alters the *.vcxproj files, the recommended way is | ||
to use build.bat: | ||
|
||
build.bat "/p:PlatformToolset=ClangCL" "/p:PreferredToolArchitecture=x64" | ||
|
||
All other build.bat options remain to work as with MSVC, so this | ||
All other build.bat options continue to work as with MSVC, so this | ||
will create a 64bit release binary. PreferredToolArchitecture is needed, | ||
because msbuild by default selects the 32bit architecture of the toolset, | ||
which uses -m32 as the default target architecture. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is genuinely required, let's add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, I don't know why I need it when building with msbuild. I do not need it in case of the IDE or when explicitely using a custom installed toolset (most probably because I've always installed 64bit versions of those). I like your suggestion and will try it out - looks promising! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But did not work out: most probably, we're "too late" when setting that, meaning that these lines in
Anyway, using the
|
||
|
@@ -79,8 +79,8 @@ platform toolset, but LLVMToolsVersion has to be set accordingly. | |
Setting the major version is enough, although you can be specific | ||
and use 18.1.8 in the above example, too. | ||
|
||
Even --pgo works out of the box, except you do want to run the PGO task | ||
on a different host than the build host. In this case you must pass | ||
Even --pgo works out of the box. However, if you want to run the PGO task | ||
chris-eibl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
on a different host than the build host, you must pass | ||
"/p:CLANG_PROFILE_PATH=<relative-path-to-instrumented-dir-on-remote-host>" | ||
in the PGInstrument step to make sure the profile data is generated | ||
into the instrumented directory when running the PGO task. | ||
|
Uh oh!
There was an error while loading. Please reload this page.