-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CMake][Support] Use /nologo when compiling BLAKE3 assembly sources on Windows #106794
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
[CMake][Support] Use /nologo when compiling BLAKE3 assembly sources on Windows #106794
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-llvm-support Author: Matt Bolitho (MattBolitho) ChangesSuppresses this extraneous
Full diff: https://github.com/llvm/llvm-project/pull/106794.diff 1 Files Affected:
diff --git a/llvm/lib/Support/BLAKE3/CMakeLists.txt b/llvm/lib/Support/BLAKE3/CMakeLists.txt
index 51317b8048f76f..7e5352208ddcbd 100644
--- a/llvm/lib/Support/BLAKE3/CMakeLists.txt
+++ b/llvm/lib/Support/BLAKE3/CMakeLists.txt
@@ -28,12 +28,18 @@ if (CAN_USE_ASSEMBLER)
check_symbol_exists(_M_X64 "" IS_X64)
if (IS_X64)
enable_language(ASM_MASM)
- list(APPEND LLVM_BLAKE3_FILES
+ set(LLVM_BLAKE3_ASM_FILES
blake3_sse2_x86-64_windows_msvc.asm
blake3_sse41_x86-64_windows_msvc.asm
blake3_avx2_x86-64_windows_msvc.asm
blake3_avx512_x86-64_windows_msvc.asm
)
+ list(APPEND LLVM_BLAKE3_FILES ${LLVM_BLAKE3_ASM_FILES})
+ # Supress the copyright message and 'Assembling...' message.
+ foreach(LLVM_BLAKE3_ASM_FILE ${LLVM_BLAKE3_ASM_FILES})
+ set_source_files_properties(${LLVM_BLAKE3_ASM_FILE}
+ PROPERTIES COMPILE_OPTIONS "/quiet;/nologo")
+ endforeach()
else()
disable_blake3_x86_simd()
endif()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for the PR.
# Supress the copyright message and 'Assembling...' message. | ||
foreach(LLVM_BLAKE3_ASM_FILE ${LLVM_BLAKE3_ASM_FILES}) | ||
set_source_files_properties(${LLVM_BLAKE3_ASM_FILE} | ||
PROPERTIES COMPILE_OPTIONS "/quiet;/nologo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, these options aren't supported by all tools...
MS ml64.exe only seems to support /quiet
since MSVC 2022 17.6, while we only require MSVC 2019 16.7 or newer.
The files can also be assembled with llvm-ml
, and that tool doesn't support the /quiet
option either.
So either we resort to only /nologo
, which does reduce the verbosity a bit here, even if not entirely, or we add a configure time check for whether /quiet
is supported by the CMAKE_ASM_MASK_COMPILER
tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Even with just /nologo
the improvement is much better imo.
I don't think the generic check_compiler_flag
function supports ASM_MASM
so the logic might get a bit involved for a small win (unless there are other places that would benefit). I am happy to use only /nologo
based on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking as changes requested - this unfortunately will break some of the currently supported configurations.
blake3_sse2_x86-64_windows_msvc.asm | ||
blake3_sse41_x86-64_windows_msvc.asm | ||
blake3_avx2_x86-64_windows_msvc.asm | ||
blake3_avx512_x86-64_windows_msvc.asm | ||
) | ||
list(APPEND LLVM_BLAKE3_FILES ${LLVM_BLAKE3_ASM_FILES}) | ||
# Supress the copyright message and 'Assembling...' message. | ||
foreach(LLVM_BLAKE3_ASM_FILE ${LLVM_BLAKE3_ASM_FILES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really need a foreach
? As far as I can see (I didn't try myself), set_source_files_properties
should be able to take more than one file at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
The PR description, which gets used as the commit message when merged, still reflects the original variant of the patch, so it’d be good to tweak that as well. Or whoever merges it can fix up the wording before pressing merge as well.
Great, thanks for the feedback! I learned a few things. Description tweaked with the compatibility concerns included too. |
Ah, sorry, one more thing, which I noticed when preparing to merge. It seems that you have you GitHub account set to keep your email private, so the commit would end up with a GitHub-noreply address. Within LLVM, we request that commits have actual real email addresses. (We’re supposed to have a bot check and tell you about this already when you submit the PR, but that doesn’t seem to have happened here.) See https://github.com/llvm/llvm-project/blob/main/.github/workflows/email-check.yaml#L34 |
Ok that's fine with me. I have disabled the option to keep them private. |
Thank you, and thanks for your contribution! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/5218 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/3745 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/4791 Here is the relevant piece of the build log for the reference
|
@MattBolitho Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/14/builds/1246 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/1015 Here is the relevant piece of the build log for the reference
|
In PR #106794, it was noted that `llvm-ml` does not support the `/quiet` flag. The original reason it was added by Microsoft to `ml`/`ml64` was to remove extraneous CMake build output (see [CMake GitLab issue](https://gitlab.kitware.com/cmake/cmake/-/issues/23537)) much like in the linked PR . If the goal is for `llvm-ml` to be a drop-in replacement for `ml`/`ml64`, then I think it makes sense to support the `/quiet` flag, much like how `/nologo` is supported.
Suppresses the copyright banner for
ml64
compiling BLAKE3 assembly sources with MSVC and Ninja on Windows:is now just:
We can suppress that last line with
/quiet
in more recent versions ofml64
(from MSVC 2022 17.6) but it is not supported by all potential MASM compilers.