[CPU] Added constant propagation pass for: OPCODE_AND_NOT

This commit is contained in:
Gliniak
2022-03-07 08:17:51 +01:00
parent 6b45cf8447
commit 0f2a7105b9
4 changed files with 31 additions and 21 deletions

View File

@@ -648,6 +648,14 @@ 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->src1.value);
v->AndNot(i->src2.value);
i->Remove();
result = true;
}
break;
case OPCODE_OR:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);