1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
Sanjay Patel 782c5d6f79 [InstCombine] fold min/max tree with common operand (PR35717)
There is precedence for factorization transforms in instcombine for FP ops with fast-math. 
We also have similar logic in foldSPFofSPF().

It would take more work to add this to reassociate because that's specialized for binops, 
and min/max are not binops (or even single instructions). Also, I don't have evidence that 
larger min/max trees than this exist in real code, but if we find that's true, we might
want to reorganize where/how we do this optimization.

In the motivating example from https://bugs.llvm.org/show_bug.cgi?id=35717 , we have:

int test(int xc, int xm, int xy) {
  int xk;
  if (xc < xm)
    xk = xc < xy ? xc : xy;
  else
    xk = xm < xy ? xm : xy;
  return xk;
}

This patch solves that problem because we recognize more min/max patterns after rL321672

https://rise4fun.com/Alive/Qjne
https://rise4fun.com/Alive/3yg

Differential Revision: https://reviews.llvm.org/D41603

llvm-svn: 321998
2018-01-08 15:05:34 +00:00
..
2016-07-16 16:24:06 +00:00
2017-01-10 23:08:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2017-10-10 05:07:54 +00:00
2016-04-17 04:30:43 +00:00
2017-05-19 22:37:09 +00:00
2016-04-05 17:24:54 +00:00
2017-04-19 12:06:40 +00:00
2016-01-07 19:27:16 +00:00
2017-04-14 17:47:07 +00:00
2016-04-05 17:24:54 +00:00

This directory contains test cases for the instcombine transformation.  The
dated tests are actual bug tests, whereas the named tests are used to test
for features that the this pass should be capable of performing.