Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/dxil-spirv.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-04-19 16:14:32 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-04-19 16:24:00 +0300
commit159a1d082a34393a29847329e0a0f1861e6eedbd (patch)
treeba182d40d2319cb688e23ab6f4722294ca4b3323
parent5ca688150c660c580795662c996dbab887574d75 (diff)
Do not attempt to selection merge to existing ladder blocks.
-rw-r--r--cfg_structurizer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cfg_structurizer.cpp b/cfg_structurizer.cpp
index b84fa6b..46377f8 100644
--- a/cfg_structurizer.cpp
+++ b/cfg_structurizer.cpp
@@ -2716,6 +2716,14 @@ void CFGStructurizer::find_selection_merges(unsigned pass)
idom = header;
}
+ // Similar, but also check if we have associated ladder blocks with the idom.
+ if (!idom->pred_back_edge)
+ {
+ auto *inner_loop_header = entry_block->get_innermost_loop_header_for(idom);
+ if (inner_loop_header && inner_loop_header->loop_ladder_block == node)
+ idom = const_cast<CFGNode *>(inner_loop_header);
+ }
+
if (pass == 0)
{
// Check that we're not merging ourselves into the aether.
@@ -2817,7 +2825,7 @@ void CFGStructurizer::find_selection_merges(unsigned pass)
//LOGI("Loop merge: %p (%s) -> %p (%s)\n", static_cast<const void *>(loop), loop->name.c_str(),
// static_cast<const void *>(node), node->name.c_str());
}
- else if (idom->loop_merge_block != node)
+ else if (idom->loop_merge_block != node && idom->loop_ladder_block != node)
{
auto *selection_idom = create_helper_succ_block(idom);
// If we split the loop header into the loop header -> selection merge header,