[RFC] FP contract = on

Hey folks,

Some progress has been made since the first thread:

http://lists.llvm.org/pipermail/llvm-dev/2017-March/111129.html

And also I think the consensus is to enable "-ffp-contract=on" by
default (instead of "fast"), which seems to be working on some
preliminary tests I made.

I just ran the test-suite on x86_64 and AArch64. The former is ok, the
latter still has some failures:

MultiSource/Applications/oggenc/oggenc
MultiSource/Benchmarks/MiBench/telecomm-FFT/telecomm-fft
MultiSource/Benchmarks/VersaBench/beamformer/beamformer

SingleSource/Benchmarks/Linpack/linpack-pc
SingleSource/Benchmarks/Misc-C++/Large/sphereflake
SingleSource/Benchmarks/Polybench/datamining
SingleSource/Benchmarks/Polybench/linear-algebra
SingleSource/Benchmarks/Polybench/stencils

Sebastian, how's the progress to get those benchmarks contract-friendly?

We mainly need to make sure that the difference in precision is *just*
because the contraction, not something else, and hopefully reduce them
below e10-4 with some tricks, to avoid surprises.

cheers,
--renato

Hi Renato,

Sebastian, how's the progress to get those benchmarks contract-friendly?

MultiSource/Benchmarks/MiBench/telecomm-FFT/telecomm-fft
MultiSource/Benchmarks/VersaBench/beamformer/beamformer

I thought that these two were already solved by these patches:
https://reviews.llvm.org/D25923 - beamformer
https://reviews.llvm.org/D25924 - telecomm-fft

SingleSource/Benchmarks/Polybench/datamining
SingleSource/Benchmarks/Polybench/linear-algebra
SingleSource/Benchmarks/Polybench/stencils

These 3 should have been fixed by this patch:
https://reviews.llvm.org/D25346

MultiSource/Applications/oggenc/oggenc
SingleSource/Benchmarks/Linpack/linpack-pc
SingleSource/Benchmarks/Misc-C++/Large/sphereflake

These are harder to modify to make them pass with contract on and off.
I recommend adding CFLAGS += "-ffp-contract=off"

Sebastian

I just had a look at these patches, and I see that they have
CFLAGS += -DFP_ABSTOLERANCE=1e-5
the tests were passing on AArch64 with that tolerance when I tested
them back in October 2016.
Renato, could you please try to see if they pass with a tolerance of 1e-4?

Hi Sebastian,

1e-4 makes no difference. :frowning:

I'll have to dig this one deeper.

cheers,
--renato