llvm-project
llvm-project copied to clipboard
[Visual Studio] Add support for Parallel Custom Build Tools
| Bugzilla Link | 39035 |
| Version | trunk |
| OS | Windows NT |
| Blocks | llvm/llvm-project#28596 |
| CC | @adibiagio,@llvm-beanz,@filcab,@gregbedwell,@rnk |
Extended Description
Visual Studio 2017 15.8 adds opt-in support for parallelised building of custom tools stages in a project:
https://blogs.msdn.microsoft.com/vcblog/2018/09/18/parallel-custom-build-tools-in-visual-studio-2017/
This will considerably help speed up llvm-tblgen builds if we can enable this as soon as any necessary cmake changes have been made.
There doesn't seem to be any movement on this on the upstream cmake project.
The vcxproj setting is:
<CustomBuild>
<BuildInParallel>true</BuildInParallel>
</CustomBuild>
Do you thing it would it be feasible for us to always emit this directly in the *CommonTableGen.vcxproj files for at least VS2019+ builds?
Thanks Chris, I've made an upstream cmake feature request here:
https://gitlab.kitware.com/cmake/cmake/issues/18405
I'll try using cmake directly at some point as well
Assuming CMake adds support for this, I see no reason not to fix it. However, with Visual Studio 17 I think the current best way to get fast builds is to use the built-in CMake support:
https://blogs.msdn.microsoft.com/vcblog/2016/10/05/cmake-support-in-visual-studio/
This uses ninja for the underlying build and gets much better build performance.
Thanks Chris, I've made an upstream cmake feature request here:
It has been implemented in CMake 3.27 but is opt-in via policy https://cmake.org/cmake/help/latest/policy/CMP0147.html.
@Kojoley So can we enable it when building with cmake >= 3.27?
@Kojoley So can we enable it when building with cmake >= 3.27?
IIUC yes, I don't know where to put it though, seems to be in https://github.com/llvm/llvm-project/blob/main/cmake/Modules/CMakePolicy.cmake?
Maybe HandleLLVMOptions.cmake?
Maybe HandleLLVMOptions.cmake?
Looking at 88d7508dc479210f07abccb17f0194b66264b125 previously policies were in llvm/CMakeLists.txt and the commit moved them to cmake/Modules/CMakePolicy.cmake.
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
- Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
- In the comments of this issue, request for it to be assigned to you, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
- Fix the issue locally.
- Run the test suite locally. Remember that the subdirectories under
test/create fine-grained testing targets, so you can e.g. usemake check-clang-astto only run Clang's AST tests. - Create a Git commit.
- Run
git clang-format HEAD~1to format your changes. - Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
@llvm/issue-subscribers-good-first-issue
Author: Simon Pilgrim (RKSimon)
Extended Description
Visual Studio 2017 15.8 adds opt-in support for parallelised building of custom tools stages in a project:
https://blogs.msdn.microsoft.com/vcblog/2018/09/18/parallel-custom-build-tools-in-visual-studio-2017/
This will considerably help speed up llvm-tblgen builds if we can enable this as soon as any necessary cmake changes have been made.
Good first issue for somebody working on windows + visualstudio and knows a little cmake