Skip to content

Commit 061de13

Browse files
vmaksimosys-ce-bb
authored andcommitted
True Label and False Label of an OpBranchConditional must not be the same (#2528)
Original commit: KhronosGroup/SPIRV-LLVM-Translator@4a6a1746c61f917
1 parent 7c8cb41 commit 061de13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,8 @@ class SPIRVBranchConditional : public SPIRVInstruction {
850850
getCondition()->getType()->isTypeBool());
851851
assert(getTrueLabel()->isForward() || getTrueLabel()->isLabel());
852852
assert(getFalseLabel()->isForward() || getFalseLabel()->isLabel());
853+
if (Module->isAllowedToUseVersion(VersionNumber::SPIRV_1_6))
854+
assert(TrueLabelId != FalseLabelId);
853855
}
854856
SPIRVId ConditionId;
855857
SPIRVId TrueLabelId;

0 commit comments

Comments
 (0)