[llvm-dev] [test-suite] making polybench/symm succeed with "-Ofast" and "-ffp-contract=on"

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 14 08:50:43 PDT 2016


----- Original Message -----
> From: "Renato Golin" <renato.golin at linaro.org>
> To: "Sebastian Pop" <sebpop.llvm at gmail.com>
> Cc: "Hal Finkel" <hfinkel at anl.gov>, "Sebastian Paul Pop" <s.pop at samsung.com>, "llvm-dev" <llvm-dev at lists.llvm.org>,
> "Matthias Braun" <matze at braunis.de>, "Clang Dev" <cfe-dev at lists.llvm.org>, "nd" <nd at arm.com>, "Abe Skolnik"
> <a.skolnik at samsung.com>
> Sent: Friday, October 14, 2016 10:36:12 AM
> Subject: Re: [test-suite] making polybench/symm succeed with "-Ofast" and "-ffp-contract=on"
> 
> On 14 October 2016 at 15:50, Sebastian Pop <sebpop.llvm at gmail.com>
> wrote:
> > These 3 tests are passing with the following configurations:
> > -O3 -ffp-contract=off
> > -O3 -ffp-contract=on
> > -O0 -ffp-contract=off
> > -O0 -ffp-contract=on
> >
> > They are not passing at:
> > -Ofast -ffp-contract=on
> > -Ofast -ffp-contract=off
> 
> Let's separate completely FP-contract and fast-math. They're
> different
> things and need different solutions.
> 
> 
> > if(TEST_SUITE_USES_FAST_MATH)
> >   add_definitions(-DFP_ABSTOLERANCE=1e0)
> > else()
> >   add_definitions(-DFP_ABSTOLERANCE=1e-5)
> > endif()
> 
> This doesn't make sense. If my program decreased precision by 5
> orders
> of magnitude with -ffast-math, I'd be *very* worried.

Is this an absolute or a relative tolerance? If this is absolute, as the name implies, then I'm not sure how to feel. We should probably use a relative tolerance where possible.

 -Hal

> 
> I hope that fast-math in Clang isn't that broken, so that's probably
> to do with the assumptions in the output reduction phase.
> 
> But, as I said, let's do Ofast *later*. One thing at a time.
> 
> cheers,
> --renato
> 

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-dev mailing list