summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir/microinstruction.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2022-03-22 23:34:31 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2022-03-23 22:57:22 +0100
commit67159e3be76cf468288ae492ea22fc43a77a9d1e (patch)
tree1430335870a66823463f56f86cd98de6f8d5c6d8 /src/shader_recompiler/frontend/ir/microinstruction.cpp
parentshader_recompiler/dead_code_elimination: Add DeadBranchElimination pass (diff)
downloadyuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar.gz
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar.bz2
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar.lz
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar.xz
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.tar.zst
yuzu-67159e3be76cf468288ae492ea22fc43a77a9d1e.zip
Diffstat (limited to 'src/shader_recompiler/frontend/ir/microinstruction.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp5
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) {
phi_args.emplace_back(predecessor, value);
}
+void Inst::ErasePhiOperand(size_t index) {
+ const auto operand_it{phi_args.begin() + static_cast<ptrdiff_t>(index)};
+ phi_args.erase(operand_it);
+}
+
void Inst::OrderPhiArgs() {
if (op != Opcode::Phi) {
throw LogicError("{} is not a Phi instruction", op);