Displaying 20 results from an estimated 6000 matches similar to: "Question on fast-math optimizations"
2018 Nov 20
2
Question on fast-math optimizations
Dear LLVM developers,
I have a question on the fast-math floating-point optimizations applied
by LLVM:
Judging by the documentation at
https://llvm.org/docs/LangRef.html#fast-math-flags I understood that
rewriting with associativity and using reciprocal computations are
possible optimizations. As the folklore description of fast-math is that
it "applies real-valued identities", I
2018 Nov 30
2
Question on fast-math optimizations
On 30.11.18 11:49, Heiko Becker via llvm-dev wrote:
> --Resending my last mail, as it might have gotten lost --
>
> Thanks Nicolai and Steve for the initial replies.
>
> So if I understand correctly there are 2 places you can pinpoint at
> where distributivity is used:
>
> - simplification of infinity/NaN expressions
>
> - combination with FMA introduction
Well
2014 Oct 13
3
[LLVMdev] RFC: variable names
On Oct 13, 2014, at 3:44 PM, Chandler Carruth <chandlerc at google.com> wrote:
> I actually have a particular allergy to member variable names and function names having similar styles:
>
> bool x = i->isMyConditionTrue;
>
> Did I mean to write 'isMyConditionTrue()'? Or 'bool &x = I->isMyConditionTrue'? Or something else? I have no idea. Warnings and
2014 Oct 13
5
[LLVMdev] RFC: variable names
On Mon, Oct 13, 2014 at 4:25 PM, Xinliang David Li <xinliangli at gmail.com>
wrote:
> On Mon, Oct 13, 2014 at 4:00 PM, Chris Lattner <clattner at apple.com> wrote:
>
>> On Oct 13, 2014, at 3:44 PM, Chandler Carruth <chandlerc at google.com>
>> wrote:
>> > I actually have a particular allergy to member variable names and
>> function names having
2016 Nov 18
2
what does -ffp-contract=fast allow?
----- Original Message -----
> From: "Sanjay Patel" <spatel at rotateright.com>
> To: "Hal J. Finkel" <hfinkel at anl.gov>
> Cc: "Mehdi Amini" <mehdi.amini at apple.com>, "llvm-dev"
> <llvm-dev at lists.llvm.org>, "cfe-dev" <cfe-dev at lists.llvm.org>,
> "andrew kaylor" <andrew.kaylor at
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
On 22.08.2018 17:52, Ryan Taylor wrote:
> This is probably going to effect on other backends and break llvm-lit
> for them?
Very likely, yes. Can you take a look at how big the fallout is? This
might give us a hint about what other frontends might expect, and who
needs to be involved in the discussion (if one is needed).
Cheers,
Nicolai
>
> On Wed, Aug 22, 2018 at 11:41 AM
2016 Nov 18
2
what does -ffp-contract=fast allow?
Sent from my Verizon Wireless 4G LTE DROID
On Nov 17, 2016 5:53 PM, Mehdi Amini <mehdi.amini at apple.com<mailto:mehdi.amini at apple.com>> wrote:
>
>
>> On Nov 17, 2016, at 4:33 PM, Hal Finkel <hfinkel at anl.gov<mailto:hfinkel at anl.gov>> wrote:
>>
>>
>> ________________________________
>>>
>>> From: "Warren
2016 Nov 17
2
what does -ffp-contract=fast allow?
This is just paraphrasing from D26602, so credit to Nicolai for first
raising the issue there.
float foo(float x, float y) {
return x * (y + 1);
}
$ ./clang -O2 xy1.c -S -o - -target aarch64 -ffp-contract=fast | grep fm
fmadd s0, s1, s0, s0
Is this a bug? We transformed the original expression into:
x * y + x
When x=INF and y=0, the code returns INF if we don't reassociate. With
2018 Aug 22
4
Condition code in DAGCombiner::visitFADDForFMACombine?
On 22.08.2018 13:29, Ryan Taylor wrote:
> The example starts as SPIR-V with the NoContraction decoration flag on
> the fmul.
>
> I think what you are saying seems valid in that if the user had put the
> flag on the fadd instead of the fmul it would not contract and so in
> this example the user needs to put the NoContraction on the fadd though
> I'm not sure
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
On 21.08.2018 16:08, Ryan Taylor via llvm-dev wrote:
> So I have a test case where:
>
> %20 = fmul nnan arcp float %15, %19
> %21 = fadd reassoc nnan arcp contract float %20, -1.000000e+00
>
> is being contracted in DAG to fmad. Is this correct since the fmul has
> no reassoc or contract fast math flag?
By having the reassoc and contract flags on fadd, the frontend is
2018 Aug 23
3
Condition code in DAGCombiner::visitFADDForFMACombine?
I don't think the global fast math flag should override the NoContraction
decoration as that's mostly the point of that decoration to begin with, to
have fine granular control while still having a broad sweeping
optimization. Did I miss your point? I feel like I did.
On Thu, Aug 23, 2018, 3:42 PM Michael Berg <michael_c_berg at apple.com> wrote:
> Ryan,
>
> Given that the
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
Maybe there is a cleaner solution but it seems like adding a 'nocontract'
flag is close to the intention of spir-v and is an easy check in the
DAGCombiner without breaking anything else and its intentions are very
clear.
Right now the DAGCombiner logic doesn't seem to be able to handle the case
of having fast math globally with instruction level flags to turn off fast
math. Right now,
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
Nicolai,
Can you do without the use of -fp-contract=fast (Options.AllowFPOpFusion == FPOpFusion::Fast ) and without Unsafe?
As I SPIR-V’s usage of NoContraction flies in the face of both.
If so, you should be able to get what you want, as then you are down to just IR flags. You will need a model to generate the correct behavior though in your SPIR-V implementation wrt IR flag emissions.
2008 May 02
1
[LLVMdev] optimization assumes malloc return is non-null
On May 2, 2008, at 2:23 PM, me22 wrote:
[...]
> I suppose the most important issue is what constitutes "observable
> behavior".
1.9/6:
«The observable behavior of the abstract machine is its sequence of
reads and writes to volatile data and calls to library
I/O functions. [ Footnote 6: An implementation can offer additional
library I/O functions as an extension.
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
Michael,
>From the spec with regards to reassoc:
– 15225 Include no re-association as a constraint required by the
NoContraction Decoration.
I don't see a solution given the situation where -fp-contract=fast and we
want to contract. Furthermore, I think a 'nocontract' flag will allow the
IR to be more readable in it's intention. The problem is you can have 2 fp
arith
2017 Jun 12
3
[Mesa-dev] [RFC 0/9] Add precise/invariant semantics to TGSI
This looks like the right idea to me too. It may sound a bit weird to do
that per instruction, but d3d11 does that as well. (Some d3d versions
just have a global flag basically forbidding or allowing any such fast
math optimizations in the assembly, but I'm not actually sure everybody
honors that without tesselation...)
For 1/9:
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
2016 Nov 17
3
RFC: Consider changing the semantics of 'fast' flag implying all fast-math-flags
>All that said, I think we (the company I work for, Sony) will have to implement support
>for these switches. It comes down to GCC has these switches (e.g., -fno-reciprocal-math
>and -fno-associative-math), and they do suppress the transformations for our customers.
>They switch to Clang/LLVM, they use the same switches, and it doesn't "work". So as a
>practical
2014 Oct 13
3
[LLVMdev] RFC: variable names
> If we are going to change how we name variables, I very much want them to
> not collide with either type names or function names. My suggestion would be
> "lower_case" names.
>
> This also happens to be the vastly most common pattern across all C++ coding
> styles and C-based language coding styles I have seen.
STL has "lower_case" functions, and exposes
2016 Nov 17
2
RFC: Consider changing the semantics of 'fast' flag implying all fast-math-flags
On the plus side, I'm glad to see the conclusions of the last couple of posts.
From Mehdi:
> Hope this clarify where I see the direction going, and even if you don’t agree with my
> reasoning, the conclusion should be satisfactory on your side :)
I'd say that summarizes my thoughts on this well.
And from Nicolai:
> Right. I'm not fundamentally opposed to having these
2016 Nov 17
2
RFC: Consider changing the semantics of 'fast' flag implying all fast-math-flags
> On Nov 17, 2016, at 1:44 PM, Mehdi Amini via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
>>
>> On Nov 17, 2016, at 1:24 PM, Ristow, Warren <warren.ristow at sony.com> wrote:
>>
>> On the plus side, I'm glad to see the conclusions of the last couple of posts.
>>
>> From Mehdi:
>>
>>> Hope this clarify where I see the