dawn-cmake/test/vk-gl-cts/graphicsfuzz/cosh-return-inf-unused
David Neto dffa60ca98 spir-writer: handle break continuing block
The continuing block can exit the loop in very constrained ways:

When a break statement is placed such that it would exit from a loop’s
§ 7.3.8 Continuing Statement, then:

   - The break statement must appear as either:
     - The only statement in the if clause of an if statement that has:
       - no else clause or an empty else clause
       - no elseif clauses
     - The only statement in the else clause of an if statement that has an
       empty if clause and no elseif clauses.
   - That if statement must appear last in the continuing clause.

By design, this allows a lossless round-trip from SPIR-V to WGSL and
back to SPIR-V.  But that requires this special case construct in WGSL
to be translated to an OpBranchConditional with one target being
the loop's megre block (which is where 'break' branches to), and the
other targets the loop header (which is the loop backedge).  That
OpBranchConditional takes the place of the normal case of an
unconditional backedge.

Avoids errors like this:
 continue construct with the continue target X is not
 post dominated by the back-edge block Y

Fixed: 1034
Change-Id: If472a179380b8d77af746a3cd8e279c8a5e56b37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59800
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-07-27 15:12:27 +00:00
..
0-opt.spvasm Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.spvasm.expected.hlsl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.spvasm.expected.msl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.spvasm.expected.spvasm spir-writer: handle break continuing block 2021-07-27 15:12:27 +00:00
0-opt.spvasm.expected.wgsl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.wgsl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.wgsl.expected.hlsl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.wgsl.expected.msl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00
0-opt.wgsl.expected.spvasm spir-writer: handle break continuing block 2021-07-27 15:12:27 +00:00
0-opt.wgsl.expected.wgsl Add tests derived from VK-GL-CTS 2021-07-23 13:10:12 +00:00