From 061de1335a7b734323bff30e403683555b67446b Mon Sep 17 00:00:00 2001 From: Viktoria Maximova Date: Wed, 26 Jun 2024 10:53:05 +0200 Subject: [PATCH] True Label and False Label of an OpBranchConditional must not be the same (#2528) Original commit: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/4a6a1746c61f917 --- llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h b/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h index 61967cc139e10..bba27599ec89a 100644 --- a/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h +++ b/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h @@ -850,6 +850,8 @@ class SPIRVBranchConditional : public SPIRVInstruction { getCondition()->getType()->isTypeBool()); assert(getTrueLabel()->isForward() || getTrueLabel()->isLabel()); assert(getFalseLabel()->isForward() || getFalseLabel()->isLabel()); + if (Module->isAllowedToUseVersion(VersionNumber::SPIRV_1_6)) + assert(TrueLabelId != FalseLabelId); } SPIRVId ConditionId; SPIRVId TrueLabelId;