-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cfg: use Tarjan's SCC algorithm to get "minimal loops" (instead of "m…
…aximal"). (#48) Quoting from the comment I added to the code: > This analysis was added to because of two observations wrt "reconvergence": > 1. syntactic loops (from some high-level language), when truly structured > (i.e. only using `while`/`do`-`while` exit conditions, not `break` etc.), > *always* map to "minimal loops" on a CFG, as the only loop exit edge is > built-in, and no part of the syntactic "loop body" can be its successor > 2. more pragmatically, compiling shader languages to SPIR-V seems to (almost?) > always *either* fully preserve syntactic loops (via SPIR-V `OpLoopMerge`), > *or* structurize CFGs in a way that produces "minimal loops", which can > be misleading with explicit `break`s (moving user code from just before > the `break` to after the loop), but is less impactful than "maximal loops" See also: * #11 (of which this only fixes the loop side, and doesn't even keep the bitflags)
- Loading branch information
Showing
6 changed files
with
283 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.