[llvm] 920ea4a - [SPIR-V] Replace assert with report_fatal (#118617)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 04:47:25 PST 2024


Author: Nathan Gauër
Date: 2024-12-04T13:47:21+01:00
New Revision: 920ea4af64d92486b75dc13e25bff32deda287b4

URL: https://github.com/llvm/llvm-project/commit/920ea4af64d92486b75dc13e25bff32deda287b4
DIFF: https://github.com/llvm/llvm-project/commit/920ea4af64d92486b75dc13e25bff32deda287b4.diff

LOG: [SPIR-V] Replace assert with report_fatal (#118617)

Irreducible must always be rejected, not only in debug builds.

Signed-off-by: Nathan Gauër <brioche at google.com>

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
index 7a1914aac8ceb8..aadaae409bf3a9 100644
--- a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
@@ -580,8 +580,9 @@ size_t PartialOrderingVisitor::visit(BasicBlock *BB, size_t Unused) {
 
     if (!CanBeVisited(BB)) {
       ToVisit.push(BB);
-      assert(QueueIndex < ToVisit.size() &&
-             "No valid candidate in the queue. Is the graph reducible?");
+      if (QueueIndex >= ToVisit.size())
+        llvm::report_fatal_error(
+            "No valid candidate in the queue. Is the graph reducible?");
       QueueIndex++;
       continue;
     }


        


More information about the llvm-commits mailing list