[llvm] fix: fix c++ narrowing conversion#183784
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-ir Author: Farid Zakaria (fzakaria) ChangesFix for the following: Full diff: https://github.com/llvm/llvm-project/pull/183784.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
index 546dbb6b64e20..51f959d2d60fb 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
@@ -274,7 +274,7 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
static_cast<bool>(FSum->flags().Live),
static_cast<bool>(FSum->flags().DSOLocal),
static_cast<bool>(FSum->flags().CanAutoHide),
- FSum->flags().ImportType,
+ static_cast<bool>(FSum->flags().ImportType),
static_cast<bool>(FSum->flags().NoRenameOnPromotion),
/*Aliasee=*/std::nullopt, Refs, FSum->type_tests(),
FSum->type_test_assume_vcalls(), FSum->type_checked_load_vcalls(),
@@ -288,7 +288,7 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
static_cast<bool>(ASum->flags().Live),
static_cast<bool>(ASum->flags().DSOLocal),
static_cast<bool>(ASum->flags().CanAutoHide),
- ASum->flags().ImportType,
+ static_cast<bool>(ASum->flags().ImportType),
static_cast<bool>(ASum->flags().NoRenameOnPromotion),
/*Aliasee=*/ASum->getAliaseeGUID()});
}
|
|
#183782 will revert the patch that is causing breakage. |
|
@boomanaiden154 is the revert going in for sure? |
I reverted #178587 and then rebased on top of main branch and cannot trigger the compilation error. BTW, for the following: My patch is not involved with 'FSum->flags().ImportType'. Maybe something else go on? |
|
The new pull request (which is on top of latest main branch, about 10:30am) |
|
|
Thanks @fzakaria, I tried the following cmake command (slightly different from you as I added -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON, otherwise, cmake won't work for me): The '..' points to llvm directory. After cmake, I did 'ninja lld' and it works fine for with #183793 on opt of #183649 and the main branch with '[flang-rt] Enable more runtime functions for the GPU target (#183649)'. Both 'ninja lld' are successful. Do you know which commit you are using which can trigger the error (as in this pull request)? |
|
Also, is not involved in my pull request #178587. So it is not clear why my patch is fixing this. It is very suspicious. |
|
Okay, looks like a build compiler issue. llvm21 build compiler is ok but llvm19 build compiler can expose the warning/error. I will do some further debug. |
|
We can re-open this PR if you need please LMK. |
Fix for the following:
validation