Message ID | 20201020211021.82394-19-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | essential OP_ADD & OP_SUB simplifications | expand |
diff --git a/simplify.c b/simplify.c index cb401d8fac9f..08b706ca8f41 100644 --- a/simplify.c +++ b/simplify.c @@ -1390,6 +1390,8 @@ static int simplify_sub(struct instruction *insn) case OP_ADD: if (def->src1 == src2) // (x + y) - x --> y return replace_with_pseudo(insn, def->src2); + if (def->src2 == src2) // (x + y) - y --> x + return replace_with_pseudo(insn, def->src1); break; } diff --git a/validation/optim/simplify-same-add-subr.c b/validation/optim/simplify-same-add-subr.c index e8540703ee7d..071021c485d7 100644 --- a/validation/optim/simplify-same-add-subr.c +++ b/validation/optim/simplify-same-add-subr.c @@ -3,7 +3,6 @@ int add_subr(int x, int y) { return (x + y) - y; } /* * check-name: simplify-same-add-subr * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-start add_subr:
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- simplify.c | 2 ++ validation/optim/simplify-same-add-subr.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)