[NFC][SPIRV] Fix compile warnings - #183725
Merged
Merged
Conversation
Contributor
Author
Member
|
@llvm/pr-subscribers-backend-spir-v Author: None (idubinov) ChangesFix compile warnings in SPIR-V Full diff: https://github.com/llvm/llvm-project/pull/183725.diff 1 Files Affected:
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index 8c3dd6f9ca800..541be63510029 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -2877,7 +2877,7 @@ bool SPIRVInstructionSelector::selectWaveReduceMax(Register ResVReg,
[&](Register InputRegister, bool IsUnsigned) {
const bool IsFloatTy =
GR.isScalarOrVectorOfType(InputRegister, SPIRV::OpTypeFloat);
- const unsigned IntOp = IsUnsigned ? SPIRV::OpGroupNonUniformUMax
+ const auto IntOp = IsUnsigned ? SPIRV::OpGroupNonUniformUMax
: SPIRV::OpGroupNonUniformSMax;
return IsFloatTy ? SPIRV::OpGroupNonUniformFMax : IntOp;
});
@@ -2892,7 +2892,7 @@ bool SPIRVInstructionSelector::selectWaveReduceMin(Register ResVReg,
[&](Register InputRegister, bool IsUnsigned) {
const bool IsFloatTy =
GR.isScalarOrVectorOfType(InputRegister, SPIRV::OpTypeFloat);
- const unsigned IntOp = IsUnsigned ? SPIRV::OpGroupNonUniformUMin
+ const auto IntOp = IsUnsigned ? SPIRV::OpGroupNonUniformUMin
: SPIRV::OpGroupNonUniformSMin;
return IsFloatTy ? SPIRV::OpGroupNonUniformFMin : IntOp;
});
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
MrSidims
approved these changes
Feb 27, 2026
sujianIBM
pushed a commit
to sujianIBM/llvm-project
that referenced
this pull request
Mar 5, 2026
Fix compile warnings in SPIR-V
```
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:2882:26: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
2882 | return IsFloatTy ? SPIRV::OpGroupNonUniformFMax : IntOp;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp: In lambda function:
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:2897:26: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
2897 | return IsFloatTy ? SPIRV::OpGroupNonUniformFMin : IntOp;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix compile warnings in SPIR-V