nir/spirv: Allow OpBranchConditional without a merge
This can happen if you have a predicated break/continue.
This commit is contained in:
parent
24523e98a4
commit
1c5393d57d
|
@ -325,12 +325,10 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list,
|
||||||
|
|
||||||
list_addtail(&if_stmt->node.link, cf_list);
|
list_addtail(&if_stmt->node.link, cf_list);
|
||||||
|
|
||||||
/* OpBranchConditional must be at the end of a block with either
|
if (block->merge &&
|
||||||
* an OpSelectionMerge or an OpLoopMerge.
|
(*block->merge & SpvOpCodeMask) == SpvOpSelectionMerge) {
|
||||||
*/
|
|
||||||
assert(block->merge);
|
|
||||||
if ((*block->merge & SpvOpCodeMask) == SpvOpSelectionMerge)
|
|
||||||
if_stmt->control = block->merge[2];
|
if_stmt->control = block->merge[2];
|
||||||
|
}
|
||||||
|
|
||||||
if_stmt->then_type = vtn_get_branch_type(then_block,
|
if_stmt->then_type = vtn_get_branch_type(then_block,
|
||||||
switch_case, switch_break,
|
switch_case, switch_break,
|
||||||
|
|
Loading…
Reference in New Issue