Open paulthomson opened 5 years ago
The message is confusing for sure, but the unreachable loop does not satisfy the rules about dominance. For example, the header (%11
) does not dominate the continue target (%13
).
Khronos internal issue 330 is relevant to this. It is unlikely that this issue will be addressed until that issue is resolved.
Yeah makes sense.
Technically, I believe the spec (v1.3) says, "the loop header must dominate the Continue Target, unless the Continue Target is unreachable in the CFG". So that seems fine. But it also says: "the Continue Target must dominate the back-edge block" and "the back-edge block must post dominate the Continue Target". Maybe those hold, depending on how you interpret the definition of dominate, although the validation error seems unrelated anyway.
The validator error stems from the way it performs the traversal to determine back-edges. Since those blocks are unreachable they get traversed after the main graph and the order they are visited will determine how the validator sees the back-edge.
@dneto0 what do you think about avoiding checks for unreachable blocks or ensuring the traversal is in binary order for unreachable blocks?
Was the wrong issue closed? It looks like 2372 should have been closed.
The following SPIRV contains an unreachable loop with an unreachable continue target and an unreachable merge block. It fails validation: