[llvm-dev] Speculative FP operation.

37 views
Skip to first unread message

Umesh Kalappa via llvm-dev

unread,
Nov 10, 2021, 4:30:49 AM11/10/21
to LLVM Developers Mailing List
Hi all,

We have a situation ,where the floating operations were hoisted
speculative from a conditional block on ARM64.

Was using the option "-mllvm --speculate-fp-insts=false" but doesn't
have any effect from LLVM 12 .

and "-ftrapping-math" is not enabled for aarch64 .

So question to the expert ,while investigating the passes we found
that simplifyCFG does this transformation and before we investigate
and prevent this transformation .

Do the group recommend any other options here ?

Thank you
~Umesh
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Umesh Kalappa via llvm-dev

unread,
Jan 11, 2022, 11:51:06 PM1/11/22
to LLVM Developers Mailing List
Hi All,

Did someone tried enabling the trapping math for the aarch64 arch ?
So that we can surpass the transformation like below.

If not ,we would like to take it up for ARM arch.

Thank you
~Umesh

Florian Hahn via llvm-dev

unread,
Jan 12, 2022, 10:17:16 AM1/12/22
to Umesh Kalappa, cfe-dev, Kaylor, Andrew via llvm-dev, Blower, Melanie I via cfe-dev
Hi,

> On Jan 12, 2022, at 04:50, Umesh Kalappa via llvm-dev <llvm...@lists.llvm.org> wrote:
>
> Hi All,
>
> Did someone tried enabling the trapping math for the aarch64 arch ?
> So that we can surpass the transformation like below.
>

As far as I know, initial trapping math support only existing for X86 at the moment.

> If not ,we would like to take it up for ARM arch.


I am not aware of anybody working on trapping math for AArch64, so any work in this area could be very valuable. I am CC’ing a couple of people who might know more about the current state of trapping math in Clang.

Cheers,
Florian

John Brawn via llvm-dev

unread,
Jan 12, 2022, 11:24:18 AM1/12/22
to Umesh Kalappa, cfe-dev, Florian Hahn, Kaylor, Andrew via llvm-dev
I'm currently working on AArch64 strict fp support (which is what's needed to enable -ftrapping-math).
There's a few patches currently in review:
https://reviews.llvm.org/D115352 (though I need to rebase this)
https://reviews.llvm.org/D115620 (needs some extra work to enable a currently xfailed test)

And I'm working on some other patches:
Miscellaneous fixes for vector instruction lowering
Model FPCR use in AArch64 instructions
Fixes related to GlobalISel (not strictly needed as GlobalISel falls back to default isel when it can't handle things)

Once all of the above is done I think that I can then mark AArch64 as supporting strict fp in clang, so that -ftrapping-math isn't ignored.

John


From: cfe-dev <cfe-dev...@lists.llvm.org> on behalf of Florian Hahn via cfe-dev <cfe...@lists.llvm.org>
Sent: 12 January 2022 15:16
To: Umesh Kalappa <umesh.k...@gmail.com>; cfe-dev <cfe...@lists.llvm.org>
Cc: Kaylor, Andrew via llvm-dev <llvm...@lists.llvm.org>; Blower, Melanie I via cfe-dev <cfe...@lists.llvm.org>
Subject: Re: [cfe-dev] [llvm-dev] Speculative FP operation.
 
Hi,

> On Jan 12, 2022, at 04:50, Umesh Kalappa via llvm-dev <llvm...@lists.llvm.org> wrote:
>
> Hi All,
>
> Did someone tried enabling the trapping math for the aarch64 arch ?
> So that we can surpass the transformation  like below.
>

As far as I know, initial trapping math support only existing for X86 at the moment.

> If not ,we would like to take it up for ARM arch.


I am not aware of anybody working on trapping math for AArch64, so any work in this area could be very valuable. I am CC’ing a couple of people who might know more about the current state of trapping math in Clang.

Cheers,
Florian
_______________________________________________

Kevin P. Neal via llvm-dev

unread,
Jan 12, 2022, 2:44:47 PM1/12/22
to Florian Hahn, Kaylor, Andrew via llvm-dev, cfe-dev
On Wed, Jan 12, 2022 at 03:16:54PM +0000, Florian Hahn via llvm-dev wrote:
> Hi,
>
> > On Jan 12, 2022, at 04:50, Umesh Kalappa via llvm-dev <llvm...@lists.llvm.org> wrote:
> >
> > Hi All,
> >
> > Did someone tried enabling the trapping math for the aarch64 arch ?
> > So that we can surpass the transformation like below.
> >
>
> As far as I know, initial trapping math support only existing for X86 at the moment.

X86, PowerPC, SystemZ.

I believe PowerPC is the only target that properly handles dynamic rounding
mode, where instructions don't get moved past a call instruction since we
don't know if the rounding mode will be changed. I might have missed the
fix for the other targets, though.
--
Kevin P. Neal http://www.pobox.com/~kpn/

Seen on bottom of IBM part number 1887724:
DO NOT EXPOSE MOUSE PAD TO DIRECT SUNLIGHT FOR EXTENDED PERIODS OF TIME.

Florian Hahn via llvm-dev

unread,
Jan 26, 2022, 11:49:49 AM1/26/22
to John Brawn, Kaylor, Andrew via llvm-dev, cfe-dev


On Jan 12, 2022, at 16:23, John Brawn <John....@arm.com> wrote:

I'm currently working on AArch64 strict fp support (which is what's needed to enable -ftrapping-math).
There's a few patches currently in review:
https://reviews.llvm.org/D115352 (though I need to rebase this)
https://reviews.llvm.org/D115620 (needs some extra work to enable a currently xfailed test)

And I'm working on some other patches:
Miscellaneous fixes for vector instruction lowering
Model FPCR use in AArch64 instructions
Fixes related to GlobalISel (not strictly needed as GlobalISel falls back to default isel when it can't handle things)

Once all of the above is done I think that I can then mark AArch64 as supporting strict fp in clang, so that -ftrapping-math isn't ignored.

That’s great news, thanks for pushing on this!


Cheers,
Florian

Reply all
Reply to author
Forward
0 new messages