glasm: Skip phi moves on undefined instructions

This commit is contained in:
ReinUsesLisp 2021-05-26 15:41:53 -03:00 committed by ameerj
parent b9c8814ea9
commit 586c785366
2 changed files with 16 additions and 1 deletions

View file

@ -58,7 +58,9 @@ void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value&
}
const Register phi_reg{ctx.reg_alloc.Consume(IR::Value{&phi})};
const Value eval_value{ctx.reg_alloc.Consume(value)};
if (!value.IsImmediate() && IR::IsUndef(RegAlloc::AliasInst(*value.Inst()))) {
return;
}
if (phi_reg == eval_value) {
return;
}