Skip to content

Commit 920ea4a

Browse files
authored
[SPIR-V] Replace assert with report_fatal (#118617)
Irreducible must always be rejected, not only in debug builds. Signed-off-by: Nathan Gauër <[email protected]>
1 parent a88653a commit 920ea4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/SPIRV/SPIRVUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,9 @@ size_t PartialOrderingVisitor::visit(BasicBlock *BB, size_t Unused) {
580580

581581
if (!CanBeVisited(BB)) {
582582
ToVisit.push(BB);
583-
assert(QueueIndex < ToVisit.size() &&
584-
"No valid candidate in the queue. Is the graph reducible?");
583+
if (QueueIndex >= ToVisit.size())
584+
llvm::report_fatal_error(
585+
"No valid candidate in the queue. Is the graph reducible?");
585586
QueueIndex++;
586587
continue;
587588
}

0 commit comments

Comments
 (0)