diff options
| author | 2022-03-25 03:21:27 +0100 | |
|---|---|---|
| committer | 2022-03-25 03:21:27 +0100 | |
| commit | d108c2873d8a7ef223ca1bd9244038823484ed37 (patch) | |
| tree | e980f9291919199b51152f48d30dc67d38febfe1 /src/shader_recompiler/frontend/ir/microinstruction.cpp | |
| parent | Merge pull request #8074 from liamwhite/cached-words (diff) | |
| parent | dead_code_elimination_pass: Remove unreachable Phi arguments (diff) | |
| download | yuzu-d108c2873d8a7ef223ca1bd9244038823484ed37.tar.gz yuzu-d108c2873d8a7ef223ca1bd9244038823484ed37.tar.xz yuzu-d108c2873d8a7ef223ca1bd9244038823484ed37.zip | |
Merge pull request #8068 from ameerj/shader-if-false
shader_recompiler/dead_code_elimination: Add DeadBranchElimination pass
Diffstat (limited to 'src/shader_recompiler/frontend/ir/microinstruction.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/microinstruction.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp index 631446cf7..4a2564f47 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.cpp +++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp | |||
| @@ -326,6 +326,11 @@ void Inst::AddPhiOperand(Block* predecessor, const Value& value) { | |||
| 326 | phi_args.emplace_back(predecessor, value); | 326 | phi_args.emplace_back(predecessor, value); |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | void Inst::ErasePhiOperand(size_t index) { | ||
| 330 | const auto operand_it{phi_args.begin() + static_cast<ptrdiff_t>(index)}; | ||
| 331 | phi_args.erase(operand_it); | ||
| 332 | } | ||
| 333 | |||
| 329 | void Inst::OrderPhiArgs() { | 334 | void Inst::OrderPhiArgs() { |
| 330 | if (op != Opcode::Phi) { | 335 | if (op != Opcode::Phi) { |
| 331 | throw LogicError("{} is not a Phi instruction", op); | 336 | throw LogicError("{} is not a Phi instruction", op); |