mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 16:37:33 +01:00
shader: Fix structured control flow on KIL instructions
This could potentially leave unvisited blocks, leading to illegal phi nodes.
This commit is contained in:
parent
cdf0cc3869
commit
a806b29cb9
@ -83,6 +83,7 @@ void IREmitter::SelectionMerge(Block* merge_block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IREmitter::Return() {
|
void IREmitter::Return() {
|
||||||
|
block->SetReturn();
|
||||||
Inst(Opcode::Return);
|
Inst(Opcode::Return);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,9 @@ std::string DumpTree(const Tree& tree, u32 indentation = 0) {
|
|||||||
for (auto stmt = tree.begin(); stmt != tree.end(); ++stmt) {
|
for (auto stmt = tree.begin(); stmt != tree.end(); ++stmt) {
|
||||||
switch (stmt->type) {
|
switch (stmt->type) {
|
||||||
case StatementType::Code:
|
case StatementType::Code:
|
||||||
ret += fmt::format("{} Block {:04x};\n", indent, stmt->code->LocationBegin());
|
ret += fmt::format("{} Block {:04x} -> {:04x} (0x{:016x});\n", indent,
|
||||||
|
stmt->code->LocationBegin(), stmt->code->LocationEnd(),
|
||||||
|
reinterpret_cast<uintptr_t>(stmt->code));
|
||||||
break;
|
break;
|
||||||
case StatementType::Goto:
|
case StatementType::Goto:
|
||||||
ret += fmt::format("{} if ({}) goto L{};\n", indent, DumpExpr(stmt->cond),
|
ret += fmt::format("{} if ({}) goto L{};\n", indent, DumpExpr(stmt->cond),
|
||||||
@ -749,8 +751,9 @@ private:
|
|||||||
current_block = block_pool.Create(inst_pool);
|
current_block = block_pool.Create(inst_pool);
|
||||||
block_list.push_back(current_block);
|
block_list.push_back(current_block);
|
||||||
}
|
}
|
||||||
IR::IREmitter{*current_block}.DemoteToHelperInvocation(continue_block);
|
IR::Block* demote_block{MergeBlock(parent, stmt)};
|
||||||
current_block = nullptr;
|
IR::IREmitter{*current_block}.DemoteToHelperInvocation(demote_block);
|
||||||
|
current_block = demote_block;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user