diff options
author | Nathan Gauër <brioche@google.com> | 2024-09-20 11:36:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-20 11:36:43 +0200 |
commit | 1ed65febd996eaa018164e880c87a9e9afc6f68d (patch) | |
tree | 08576b302ae0d926bc397005160c50f3b45a02f2 /lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp | |
parent | 9a32f28366b1099b0f5214e62473c0a2a2155434 (diff) | |
download | llvm-1ed65febd996eaa018164e880c87a9e9afc6f68d.zip llvm-1ed65febd996eaa018164e880c87a9e9afc6f68d.tar.gz llvm-1ed65febd996eaa018164e880c87a9e9afc6f68d.tar.bz2 |
[SPIR-V] Add SPIR-V structurizer (#107408)
This commit adds an initial SPIR-V structurizer.
It leverages the previously merged passes, and the convergence region
analysis to determine the correct merge and continue blocks for SPIR-V.
The first part does a branch cleanup (simplifying switches, and
legalizing them), then merge instructions are added to cycles,
convergent and later divergent blocks.
Then comes the important part: splitting critical edges, and making sure
the divergent construct boundaries don't cross.
- we split blocks with multiple headers into 2 blocks.
- we split blocks that are a merge blocks for 2 or more constructs:
SPIR-V spec disallow a merge block to be shared by 2
loop/switch/condition construct.
- we split merge & continue blocks: SPIR-V spec disallow a basic block
to be both a continue block, and a merge block.
- we remove superfluous headers: when a header doesn't bring more info
than the parent on the divergence state, it must be removed.
This PR leverages the merged SPIR-V simulator for testing, as long as
spirv-val. For now, most DXC structurization tests are passing. The
unsupported ones are either caused by unsupported features like switches
on boolean types, or switches in region exits, because the MergeExit
pass doesn't support those yet (there is a FIXME).
This PR is quite large, and the addition not trivial, so I tried to keep
it simple. E.G: as soon as the CFG changes, I recompute the dominator
trees and other structures instead of updating them.
---------
Signed-off-by: Nathan Gauër <brioche@google.com>
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp')
0 files changed, 0 insertions, 0 deletions