[PATCH] [OpenCL] use -cl-fast-relaxed-math to relax math
Matthew.Arsenault at amd.com
Mon Dec 1 08:13:20 PST 2014
On 12/01/2014 10:19 AM, Pekka Jääskeläinen wrote:
> Here's a trivial patch to relax the FP math also
> if -cl-fast-relaxed-math is set.
I think the test should also check for the function target attribute.
What about the other flags? I think this patch should handle (maybe just
test?) all of the CL fast math flags instead of just this one (
-cl-finite-math-only, and -cl-fast-relaxed-math)
> This supersedes the previous patch with title
> "if unsafe-fp-math FN attribute is set, enable reduction
> detection with float operations"
> On 11/28/2014 08:04 PM, Pekka Jääskeläinen wrote:
>> Hi Hal,
>> OK, I didn't know which way was the chosen "future approach" or
>> if they both are used for some use cases.
>> I just noticed that when I set -cl-fast-relaxed-math in OpenCL C,
>> it didn't propagate to the FP instructions as 'fast' attributes,
>> but the func attribute did get set.
>> So I suppose it should be investigated why the flags are not
>> generated to the produced instructions in this case instead
>> in case the fnattr is deprecated?
>> On 11/28/2014 07:43 PM, Hal Finkel wrote:
>>> What's your motivation for doing this? Aside from the fact that we
>>> can't yet set fast math flags on function calls (to sqrt, etc.), I
>>> think we're pretty close to removing the function attribute all
>>> together. The instruction-level flags play much nicer with LTO, and
>>> give more precision control to the frontends; it is not clear to me
>>> that overriding them with the function-level attribute is desirable.
>>> ----- Original Message -----
>>>> From: "Pekka Jääskeläinen" <pekka.jaaskelainen at tut.fi> To: "Commit
>>>> Messages and Patches for LLVM" <llvm-commits at cs.uiuc.edu> Sent:
>>>> Friday, November 28, 2014 11:13:39 AM Subject: [PATCH]
>>>> [LoopVectorizer] if unsafe-fp-math FN attribute is set, enable
>>>> reduction detection with float operations
>>>> The attached patch checks the function attributes for
>>>> "unsafe-fp-math" to relax FP constraints when detecting reduction
>>>> -- --Pekka
>>>> _______________________________________________ llvm-commits
>>>> mailing list llvm-commits at cs.uiuc.edu
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits