-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix warnings while compiling SLPVectorizer.cpp #118051
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
Conversation
@llvm/pr-subscribers-vectorizers Author: Anutosh Bhat (anutosh491) ChangesTowards #118048 I was building llvm (clang and lld) for webassembly and came across these warnings. Not sure if they are seen in our builds too. This PR tries to address those warnings. Full diff: https://github.com/llvm/llvm-project/pull/118051.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 48a8520a966fc7..f0e20e870f7a16 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6919,7 +6919,7 @@ void BoUpSLP::tryToVectorizeGatheredLoads(
// 2. All users are deleted.
// 3. The load broadcasts are not allowed or the load is not
// broadcasted.
- if (std::distance(LI->user_begin(), LI->user_end()) !=
+ if (static_cast<unsigned int>(std::distance(LI->user_begin(), LI->user_end())) !=
LI->getNumUses())
return false;
if (!IsLegalBroadcastLoad)
@@ -9762,7 +9762,7 @@ void BoUpSLP::transformNodes() {
Slice.front()->getType(), 2 * VF)),
1U, 2 * VF)) ||
count(Slice, Slice.front()) ==
- (isa<UndefValue>(Slice.front()) ? VF - 1 : 1)) {
+ static_cast<long>(isa<UndefValue>(Slice.front()) ? VF - 1 : 1)) {
if (IsSplat)
continue;
InstructionsState S = getSameOpcode(Slice, *TLI);
|
@llvm/pr-subscribers-llvm-transforms Author: Anutosh Bhat (anutosh491) ChangesTowards #118048 I was building llvm (clang and lld) for webassembly and came across these warnings. Not sure if they are seen in our builds too. This PR tries to address those warnings. Full diff: https://github.com/llvm/llvm-project/pull/118051.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 48a8520a966fc7..f0e20e870f7a16 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6919,7 +6919,7 @@ void BoUpSLP::tryToVectorizeGatheredLoads(
// 2. All users are deleted.
// 3. The load broadcasts are not allowed or the load is not
// broadcasted.
- if (std::distance(LI->user_begin(), LI->user_end()) !=
+ if (static_cast<unsigned int>(std::distance(LI->user_begin(), LI->user_end())) !=
LI->getNumUses())
return false;
if (!IsLegalBroadcastLoad)
@@ -9762,7 +9762,7 @@ void BoUpSLP::transformNodes() {
Slice.front()->getType(), 2 * VF)),
1U, 2 * VF)) ||
count(Slice, Slice.front()) ==
- (isa<UndefValue>(Slice.front()) ? VF - 1 : 1)) {
+ static_cast<long>(isa<UndefValue>(Slice.front()) ? VF - 1 : 1)) {
if (IsSplat)
continue;
InstructionsState S = getSameOpcode(Slice, *TLI);
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Thanks for the review @alexey-bataev :) |
I think you approved this last week but hasn't been merged yet. |
Towards #118048
I was building llvm (clang and lld) for webassembly and came across these warnings. Not sure if they are seen in our builds too.
This PR tries to address those warnings.