[llvm] d7259bb - [SPIRV][NFC] fix build warning and error
Ilia Diachkov via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 15:38:14 PST 2023
Author: Ilia Diachkov
Date: 2023-02-03T03:26:11+03:00
New Revision: d7259bb7c9b07f5499321bb233ca09ae149f45cb
URL: https://github.com/llvm/llvm-project/commit/d7259bb7c9b07f5499321bb233ca09ae149f45cb
DIFF: https://github.com/llvm/llvm-project/commit/d7259bb7c9b07f5499321bb233ca09ae149f45cb.diff
LOG: [SPIRV][NFC] fix build warning and error
The patch fixes gcc's warning in SPIRVUtils.cpp after D142532.
Also it fixes compilation error by MSVC in SPIRVBuiltins.cpp.
Differential Revision: https://reviews.llvm.org/D142937
Added:
Modified:
llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
llvm/lib/Target/SPIRV/SPIRVUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
index fd9f5b226ab90..d3876f4ba7469 100644
--- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
@@ -1733,7 +1733,8 @@ static bool generateConvertInst(const StringRef DemangledCall,
SPIRV::Decoration::SaturatedConversion, {});
if (Builtin->IsRounded)
buildOpDecorate(Call->ReturnRegister, MIRBuilder,
- SPIRV::Decoration::FPRoundingMode, {Builtin->RoundingMode});
+ SPIRV::Decoration::FPRoundingMode,
+ {(unsigned)Builtin->RoundingMode});
unsigned Opcode = SPIRV::OpNop;
if (GR->isScalarOrVectorOfType(Call->Arguments[0], SPIRV::OpTypeInt)) {
diff --git a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
index 89bb28abfd4f4..df1817f91cf87 100644
--- a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
@@ -208,6 +208,7 @@ SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord) {
case AtomicOrdering::NotAtomic:
return SPIRV::MemorySemantics::None;
}
+ llvm_unreachable(nullptr);
}
MachineInstr *getDefInstrMaybeConstant(Register &ConstReg,
More information about the llvm-commits
mailing list