<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 09/07/2017 07:03 PM, Jason Ekstrand
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOFGe95ih0ShS+T+_TakNMz1AL8WUN4wdGaM-N0aG-9_o8o7FA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Aug 24, 2017 at 8:16 AM, Juan
A. Suarez Romero <span dir="ltr"><<a
href="mailto:jasuarez@igalia.com" target="_blank"
moz-do-not-send="true">jasuarez@igalia.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">When a
conditional branch has the same labels in the "if" part
and in the<br>
"else" part, then we have the same cfg block, and it must
be handled<br>
once.<br>
<br>
Fixes:<br>
dEQP-VK.spirv_assembly.<wbr>instruction.compute.<wbr>conditional_branch.same_<wbr>labels*<br>
dEQP-VK.spirv_assembly.<wbr>instruction.graphics.<wbr>conditional_branch.same_<wbr>labels*<br>
---<br>
src/compiler/spirv/vtn_cfg.c | 7 +++++--<br>
1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/vtn_cfg.c
b/src/compiler/spirv/vtn_cfg.c<br>
index 03c452cb31..bfca7043cc 100644<br>
--- a/src/compiler/spirv/vtn_cfg.c<br>
+++ b/src/compiler/spirv/vtn_cfg.c<br>
@@ -356,8 +356,11 @@ vtn_cfg_walk_blocks(struct
vtn_builder *b, struct list_head *cf_list,<br>
switch_case, switch_break,<br>
loop_break, loop_cont);<br>
<br>
- if (if_stmt->then_type ==
vtn_branch_type_none &&<br>
- if_stmt->else_type ==
vtn_branch_type_none) {<br>
+ if (then_block == else_block) {<br>
+ block = then_block;<br>
+ continue;<br>
</blockquote>
<div><br>
</div>
<div>This isn't quite sufficient. This needs to be handled
the same way as OpBranch. In particular,</div>
<div><br>
</div>
<div>block->branch_type = if_stmt->then_type;</div>
<div>if (block->branch_type == vtn_branch_type_none) {</div>
<div> block = then_block;</div>
<div> continue;<br>
</div>
<div>} else {</div>
<div> return;<br>
</div>
<div>}<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
OK, thanks. I am going to send a v2 soon.<br>
<br>
Sam<br>
<br>
<blockquote type="cite"
cite="mid:CAOFGe95ih0ShS+T+_TakNMz1AL8WUN4wdGaM-N0aG-9_o8o7FA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+ } else if (if_stmt->then_type ==
vtn_branch_type_none &&<br>
+ if_stmt->else_type ==
vtn_branch_type_none) {<br>
/* Neither side of the if is something we can
short-circuit. */<br>
assert((*block->merge & SpvOpCodeMask)
== SpvOpSelectionMerge);<br>
struct vtn_block *merge_block =<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org"
moz-do-not-send="true">mesa-dev@lists.freedesktop.org</a><br>
<a
href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
mesa-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>