aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
diff options
context:
space:
mode:
authorIgor Wodiany <igor.wodiany@imgtec.com>2025-02-24 22:21:58 +0000
committerGitHub <noreply@github.com>2025-02-24 17:21:58 -0500
commit594919c263122e1d0468dfecee6eb5962e892b44 (patch)
tree19b52c6048cd3f9fc32fce9dc57abdbedaa86cb6 /llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
parent0caa8f42be0b2d00527ad2d94144dcbb2a427605 (diff)
downloadllvm-594919c263122e1d0468dfecee6eb5962e892b44.zip
llvm-594919c263122e1d0468dfecee6eb5962e892b44.tar.gz
llvm-594919c263122e1d0468dfecee6eb5962e892b44.tar.bz2
[mlir][spirv] Split conditional basic blocks during deserialization (#127639)
With the current design some of the values are sank into a selection region, despite them being also used outside that region. This is because the current deserializer logic sinks the entire basic block containing a conditional branch forming a header of a selection construct, without accounting for some values being used outside. This manifests as (for example): ``` <unknown>:0: error: 'spirv.Variable' op failed control flow structurization: it has uses outside of the enclosing selection/loop construct <unknown>:0: note: see current operation: %0 = "spirv.Variable"()<{storage_class = #spirv.storage_class<Function>}> : () -> !spirv.ptr<vector<4xf32>, Function> ``` The proposed solution to this problem is to split the conditional basic block into two, one block containing just the conditional branch, and other the rest of instructions. By doing this, the logic that structures selection regions, only sinks the comparison, keeping the rest of instructions outside the selection region. A SPIR-V test is required, as the problem can happen only during deserialization and cannot be tested with `--test-spirv-roundtrip`. An MLIR test exhibiting the problematic behaviour would be an incorrect MLIR in the first place. This solution is proposed as an alternative to an unfinished PR #123371, that is unlikely to be merged in the foreseeable future, as the author "stepped away from this for a time being". There is also a Discourse thread: https://discourse.llvm.org/t/spir-v-uses-outside-the-selection-region/84494 that tried to solicit some feedback on the topic.
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp')
0 files changed, 0 insertions, 0 deletions