[CPU] Added constant propagation pass for: OPCODE_AND_NOT

This commit is contained in:
Gliniak
2022-03-07 08:17:51 +01:00
committed by Triang3l
parent 1887ea0795
commit c5e6352c34
2 changed files with 24 additions and 21 deletions

View File

@@ -648,6 +648,15 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder, bool& result) {
result = true;
}
break;
case OPCODE_AND_NOT:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src2.value);
v->Not();
v->And(i->src1.value);
i->Remove();
result = true;
}
break;
case OPCODE_OR:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);