fix(recompiler): privatize shared continuations before loop gateways
This commit is contained in:
parent
e6c8e1e9c7
commit
b0c86ec07f
|
|
@ -409,6 +409,8 @@ int main(int argc, char** argv) {
|
|||
return failures == 0 ? 0 : 1;
|
||||
}
|
||||
const std::vector<Program> programs{
|
||||
{"nested selections share a loop continuation", "Synthetic loop with two nested selections and a shared continue; the inner selection does not dominate the continuation.",
|
||||
{0x060202ffu, 0x3f800000u, 0x060202ffu, 0x3f810000u, 0x7d880084u, 0xbf870001u, 0xbf820018u, 0x060202ffu, 0x3f820000u, 0x7d880085u, 0xbf87000cu, 0x060202ffu, 0x3f850000u, 0x7d880088u, 0xbf870003u, 0x060202ffu, 0x3f870000u, 0xbf82fff0u, 0x060202ffu, 0x3f860000u, 0x7d880089u, 0xbf87fff9u, 0xbf820008u, 0x060202ffu, 0x3f830000u, 0x7d880086u, 0xbf870001u, 0xbf820003u, 0x060202ffu, 0x3f840000u, 0xbf82fff0u, 0x060202ffu, 0x3f880000u, 0xe0700000u, 0x80000100u, 0xbf810000u}, Split::None},
|
||||
{"reduced shared exit junction from the public CFG fuzz report", "Public reduced word stream from #2762; synthetic regression, not title data.",
|
||||
{0x060202f2u, 0x060202f4u, 0x7d880084u, 0xbf870001u, 0xbf820011u, 0x060202ffu, 0x3f820000u, 0x7d880085u, 0xbf870005u,
|
||||
0x060202ffu, 0x3f850000u, 0x7d880088u, 0xbf870009u, 0xbf82fff3u, 0x060202ffu, 0x3f840000u, 0x7d880087u, 0xbf870001u,
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ int main() {
|
|||
auto chain = makeGraph(diamonds);
|
||||
Structurizer{}.Structurize(chain);
|
||||
requireExactPostDominators(chain, "a chain of fifty selections");
|
||||
requireStructuredLoop({{1}, {2, 8}, {3, 5}, {4, 8}, {7}, {6, 7}, {7, 8}, {1}, {}}, "nested selections sharing a loop continuation");
|
||||
auto sharedDiscard = makeGraph({{5, 1}, {4, 2}, {7, 3}, {7, 4}, {5}, {7, 6}, {}, {}});
|
||||
const std::vector<std::uint32_t> sharedDiscardWords{444, 1944, 68, 1128, 8, 2084, 148, 28};
|
||||
for (auto& block : sharedDiscard.blocks) {
|
||||
|
|
|
|||
|
|
@ -567,7 +567,7 @@ std::uint32_t findSelectionMerge(const ControlFlowGraph& graph, const BasicBlock
|
|||
return globalMerge;
|
||||
}
|
||||
|
||||
if (routeLeavingExits && graph.Dominates(block.id, loop->continueBlock) && reachesWithinIteration(graph, *loop, trueTarget, loop->continueBlock) && reachesWithinIteration(graph, *loop, falseTarget, loop->continueBlock)) {
|
||||
if (routeLeavingExits && reachesWithinIteration(graph, *loop, trueTarget, loop->continueBlock) && reachesWithinIteration(graph, *loop, falseTarget, loop->continueBlock)) {
|
||||
return joinWithinIteration(graph, *loop, trueTarget, falseTarget, loop->continueBlock);
|
||||
}
|
||||
if (isLoopControlGateway(graph, *loop, trueTarget) && graph.Dominates(block.id, trueTarget) && isInsideLoopConstruct(graph, *loop, falseTarget)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue