diff options
| -rw-r--r-- | simplify.c | 2 | ||||
| -rw-r--r-- | validation/optim/simplify-same-subr-add.c | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -1399,6 +1399,8 @@ static int simplify_sub(struct instruction *insn) case OP_ADD: if (src1 == def->src1) // x - (x + z) --> -z return replace_with_unop(insn, OP_NEG, def->src2); + if (src1 == def->src2) // x - (y + x) --> -y + return replace_with_unop(insn, OP_NEG, def->src1); break; case OP_NEG: // (x - -y) --> (x + y) insn->opcode = OP_ADD; diff --git a/validation/optim/simplify-same-subr-add.c b/validation/optim/simplify-same-subr-add.c index bafd2643..950c55f6 100644 --- a/validation/optim/simplify-same-subr-add.c +++ b/validation/optim/simplify-same-subr-add.c @@ -3,7 +3,6 @@ int subr_add(int x, int y) { return x - (y + x); } /* * check-name: simplify-same-subr-add * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-contains: neg\\..* %arg2 |
