[llvm-dev] [RFC] Eliminating non-IR floating-point controls in the selection DAG

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 1 06:33:12 PDT 2021


I agree that we should remove the target options as an override for FMF.
But we should be aware of a current shortcoming in IR/node-level FMF.
Here's a simple recent example:
https://llvm.org/PR52259

When compiled with -fno-signed-zeros ("nsz"), we want this to be
"llvm.fabs" in IR:

double floatingAbs(double x) {
  if (x < 0) return -x;
  return x;
}

But it doesn't work because the application of FMF is incomplete (or the
FMF design is broken?) - we don't have FMF on function arguments or loaded
FP values.

This patch proposes to solve that example by using function-level
attributes:
https://reviews.llvm.org/D112283

IIUC, removing the target options still allows for the function attribute
override to FMF, so we will still have a potential work-around for the
holes in FMF design/implementation.



On Sat, Oct 30, 2021 at 4:02 PM Renato Golin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On Sat, 30 Oct 2021 at 17:56, Craig Topper <craig.topper at gmail.com> wrote:
>
>> I thought the target options were older than FMF. I don't think they were
>> created as a workaround for a shortcoming of FMF. Though that may be what
>> they've become.
>>
>
> This is what I read from Pengfei's reply. Target options are being used
> that way, not created that way.
>
> --renato
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211101/4150dbba/attachment.html>


More information about the llvm-dev mailing list