tree-optimization/94234 - add plusminus-with-convert pattern
authorFeng Xue <fxue@os.amperecomputing.com>
Mon, 17 Aug 2020 15:00:35 +0000 (23:00 +0800)
committerFeng Xue <fxue@os.amperecomputing.com>
Tue, 15 Sep 2020 14:51:28 +0000 (22:51 +0800)
commit8f0d743c2dee6afae5c6f861b0642b7b112a4a70
treedc5f349561cd3bf9bbdca113a1504741fa88b513
parent9e89fa0e2d7da77236cad50c0a9a33b7a4b97367
tree-optimization/94234 - add plusminus-with-convert pattern

Add a rule (T)(A) +- (T)(B) -> (T)(A +- B), which works only when (A +- B)
could be folded to a simple value. By this rule, a plusminus-mult-with-convert
expression could be handed over to the rule (A * C) +- (B * C) -> (A +- B).

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

gcc/
PR tree-optimization/94234
* match.pd (T)(A) +- (T)(B) -> (T)(A +- B): New simplification.

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