Nicolai Haehnle 33ca182c91 [DAGCombiner] do not fold (fmul (fadd X, 1), Y) -> (fmad X, Y, Y) by default
Summary:
When X = 0 and Y = inf, the original code produces inf, but the transformed
code produces nan. So this transform (and its relatives) should only be
used when the no-infs-fp-math flag is explicitly enabled.

Also disable the transform using fmad (intermediate rounding) when unsafe-math
is not enabled, since it can reduce the precision of the result; consider this
example with binary floating point numbers with two bits of mantissa:

  x = 1.01
  y = 111

  x * (y + 1) = 1.01 * 1000 = 1010 (this is the exact result; no rounding occurs at any step)

  x * y + x = 1000.11 + 1.01 =r 1000 + 1.01 = 1001.01 =r 1000 (with rounding towards zero)

The example relies on rounding towards zero at least in the second step.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98578

Reviewers: RKSimon, tstellarAMD, spatel, arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 288506
2016-12-02 16:06:18 +00:00
..
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-05-05 20:07:37 +00:00
2016-02-08 19:06:01 +00:00
2016-11-10 16:02:37 +00:00
2016-11-17 03:49:01 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-06-02 19:54:26 +00:00
2016-11-15 02:25:28 +00:00
2016-11-13 07:01:11 +00:00
2016-05-05 20:07:37 +00:00
2016-11-13 07:01:11 +00:00
2016-11-13 07:01:11 +00:00
2016-06-09 23:42:54 +00:00
2016-06-09 23:42:54 +00:00
2016-11-13 07:01:11 +00:00
2016-11-15 02:25:28 +00:00
2016-11-15 02:25:28 +00:00
2016-11-15 02:25:28 +00:00
2016-07-22 17:01:21 +00:00
2016-07-22 17:01:21 +00:00
2016-11-13 07:01:11 +00:00
2016-06-02 19:54:26 +00:00
2016-11-13 07:01:11 +00:00
2016-05-28 00:19:52 +00:00
2016-06-09 19:17:15 +00:00
2016-07-09 08:02:28 +00:00
2016-07-09 08:02:28 +00:00
2016-11-13 07:01:11 +00:00
2016-05-05 20:07:37 +00:00
2016-11-13 07:01:11 +00:00
2016-05-05 20:07:37 +00:00
2016-11-13 07:01:11 +00:00
2016-05-05 20:07:37 +00:00
2016-06-02 19:54:26 +00:00
2016-06-02 19:54:26 +00:00
2016-06-02 19:54:26 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-06-02 19:54:26 +00:00
2016-06-02 19:54:26 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-06-02 19:54:26 +00:00
2016-05-05 20:07:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-06-15 00:11:01 +00:00
2016-05-05 20:07:37 +00:00
2016-05-05 20:07:37 +00:00
2016-08-02 22:25:04 +00:00
2016-11-01 10:26:48 +00:00
2016-11-16 03:16:26 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-10 16:02:37 +00:00
2016-11-01 10:26:48 +00:00
2016-11-13 07:01:11 +00:00
2016-11-13 07:01:11 +00:00
2016-11-10 16:02:37 +00:00

+==============================================================================+
| How to organize the lit tests                                                |
+==============================================================================+

- If you write a test for matching a single DAG opcode or intrinsic, it should
  go in a file called {opcode_name,intrinsic_name}.ll (e.g. fadd.ll)

- If you write a test that matches several DAG opcodes and checks for a single
  ISA instruction, then that test should go in a file called {ISA_name}.ll (e.g.
  bfi_int.ll

- For all other tests, use your best judgement for organizing tests and naming
  the files.

+==============================================================================+
| Naming conventions                                                           |
+==============================================================================+

- Use dash '-' and not underscore '_' to separate words in file names, unless
  the file is named after a DAG opcode or ISA instruction that has an
  underscore '_' in its name.