[PATCH] D142937: [SPIRV][NFC] fix build warning in SPIRVUtils.cpp

Ilia Diachkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 14:16:51 PST 2023


iliya-diyachkov created this revision.
iliya-diyachkov added reviewers: mpaszkowski, arsenm, zuban32, foad, MaskRay.
Herald added subscribers: StephenFan, ThomasRaoux, hiraditya.
Herald added a project: All.
iliya-diyachkov requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

This patch fixes the following build warning from gcc in SPIRVUtils.cpp after D142532 <https://reviews.llvm.org/D142532> changes:

  [ 83%] Building CXX object lib/Target/SPIRV/CMakeFiles/LLVMSPIRVCodeGen.dir/SPIRVUtils.cpp.o
  /storage/home/idyachkov/spirv/llvm-project/llvm/lib/Target/SPIRV/SPIRVUtils.cpp: In function \u2018llvm::SPIRV::MemorySemantics::MemorySemantics llvm::getMemSemantics(llvm::AtomicOrdering)\u2019:
  /storage/home/idyachkov/spirv/llvm-project/llvm/lib/Target/SPIRV/SPIRVUtils.cpp:211:1: warning: control reaches end of non-void function [-Wreturn-type]
   }

The patched code is  Ok with gcc and llvm, but I have not tested MSVC compiler.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142937

Files:
  llvm/lib/Target/SPIRV/SPIRVUtils.cpp


Index: llvm/lib/Target/SPIRV/SPIRVUtils.cpp
===================================================================
--- llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+++ llvm/lib/Target/SPIRV/SPIRVUtils.cpp
@@ -208,6 +208,7 @@
   case AtomicOrdering::NotAtomic:
     return SPIRV::MemorySemantics::None;
   }
+  return SPIRV::MemorySemantics::None;
 }
 
 MachineInstr *getDefInstrMaybeConstant(Register &ConstReg,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142937.493380.patch
Type: text/x-patch
Size: 401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230130/be75c2cd/attachment.bin>


More information about the llvm-commits mailing list