[llvm] 77f1480 - [SPIRV] Fix return value of runOnModule for SPIRVPrepareFunctions (#184636)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 08:28:17 PST 2026


Author: Nick Sarnie
Date: 2026-03-04T16:28:12Z
New Revision: 77f1480f7ef1af79e3db57be899e73abd1c59a9f

URL: https://github.com/llvm/llvm-project/commit/77f1480f7ef1af79e3db57be899e73abd1c59a9f
DIFF: https://github.com/llvm/llvm-project/commit/77f1480f7ef1af79e3db57be899e73abd1c59a9f.diff

LOG: [SPIRV] Fix return value of runOnModule for SPIRVPrepareFunctions (#184636)

We need to return `true` if the module is changed by the pass, and we
forgot to do that in this new case.

This fixes a buildbot
[fail](https://lab.llvm.org/buildbot/#/builders/187/builds/17475).

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp b/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
index 219dd2b7f0ca0..06b39800d2f06 100644
--- a/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
@@ -666,6 +666,7 @@ bool SPIRVPrepareFunctions::runOnModule(Module &M) {
       .getMutableSubtargetImpl()
       ->resolveEnvFromModule(M);
 
+  bool Changed = false;
   if (M.functions().empty()) {
     // If there are no functions, insert a service
     // function so that the global/constant tracking intrinsics
@@ -675,9 +676,9 @@ bool SPIRVPrepareFunctions::runOnModule(Module &M) {
     BasicBlock *BB = BasicBlock::Create(M.getContext(), "entry", SF);
     IRBuilder<> IRB(BB);
     IRB.CreateRetVoid();
+    Changed = true;
   }
 
-  bool Changed = false;
   for (Function &F : M) {
     Changed |= substituteIntrinsicCalls(&F);
     Changed |= sortBlocks(F);


        


More information about the llvm-commits mailing list