tree-optimization/94234 - Fold plusminus_mult expr with multi-use operands
authorFeng Xue <fxue@os.amperecomputing.com>
Tue, 1 Sep 2020 09:17:58 +0000 (17:17 +0800)
committerFeng Xue <fxue@os.amperecomputing.com>
Tue, 15 Sep 2020 03:14:01 +0000 (11:14 +0800)
commitf9d2def016410a2095df6b399097b482f82064a5
tree20271e5733559c91f04ca141f03903b0907d9af2
parent50a71cd0182ae11444bc7b582a3b1cb1c54c7a0d
tree-optimization/94234 - Fold plusminus_mult expr with multi-use operands

2020-09-03  Feng Xue  <fxue@os.amperecomputing.com>

gcc/
PR tree-optimization/94234
* genmatch.c (dt_simplify::gen_1): Emit check on final simplification
result when "!" is specified on toplevel output expr.
* match.pd ((A * C) +- (B * C) -> (A +- B) * C): Allow folding on expr
with multi-use operands if final result is a simple gimple value.

gcc/testsuite/
PR tree-optimization/94234
* gcc.dg/pr94234-2.c: New test.
gcc/genmatch.c
gcc/match.pd
gcc/testsuite/gcc.dg/pr94234-2.c [new file with mode: 0644]