mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 16:55:46 +00:00
dead_code_elimination_pass: Remove unreachable Phi arguments
This commit is contained in:
parent
09128c9106
commit
6091af472a
3 changed files with 36 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue