Hi Marc,

On 21/04/16 11:32, Marc Glisse wrote:
Hello,

another simple transformation.

Instead of the ":s", I had single_use (@2) || single_use (@3), but changed it for simplicity. There may be some patterns in match.pd where we want something like that though, as requiring single_use on many expressions may be stricter than we need.

We could generalize to cases where overflow is not undefined if we know (VRP) 
that the variables are not TYPE_MIN_VALUE, but that didn't look like a priority.

Bootstrap+regtest on powerpc64le-unknown-linux-gnu.

2016-04-21  Marc Glisse  <marc.gli...@inria.fr>

gcc/
    * match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)):
    New transformations.

gcc/testsuite/
    * gcc.dg/tree-ssa/minmax-2.c: New testcase.



I see the new testcase failing on aarch64:
FAIL: gcc.dg/tree-ssa/minmax-2.c scan-tree-dump optimized "__builtin_fmin"

The tree dump for the function 'h' is:
h (double x, double y)
{
  double _2;
  double _4;
  double _5;

  <bb 2>:
  _2 = -x_1(D);
  _4 = -y_3(D);
  _5 = __builtin_fmax (_2, _4);
  return _5;

}

Kyrill

Reply via email to