Skip to content

[NFC][SPIRV] Fix compile warnings - #183725

Merged
MrSidims merged 2 commits into
llvm:mainfrom
idubinov:task_FIXBEWARNINGS
Feb 27, 2026
Merged

MrSidims merged 2 commits into
llvm:mainfrom
idubinov:task_FIXBEWARNINGS

Conversation

@idubinov

Copy link
Copy Markdown
Contributor

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;
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@idubinov

Copy link
Copy Markdown
Contributor Author

@MrSidims

@llvmbot

llvmbot commented Feb 27, 2026

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-backend-spir-v

Author: None (idubinov)

Changes

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;
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Full diff: https://github.com/llvm/llvm-project/pull/183725.diff

1 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp (+2-2)
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;
       });

@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

✅ With the latest revision this PR passed the C/C++ code formatter.

@MrSidims MrSidims changed the title [SPIRV] Fix compile warnings [NFC][SPIRV] Fix compile warnings Feb 27, 2026
@MrSidims
MrSidims merged commit 7402312 into llvm:main Feb 27, 2026
11 checks passed
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;
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants