[PATCH] D127964: [DCE] Eliminate no-op atan and atan2 calls

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 05:19:49 PDT 2022


spatel added a comment.

In D127964#3736290 <https://reviews.llvm.org/D127964#3736290>, @ro wrote:

> Unfortunately, the fix isn't complete yet: I still get a `FAIL` on Solaris/amd64 (`atan.ll.x86_64` is the Linux/x86_64 output, `atan.ll.amd64` the Solaris/amd64 one):

IIUC, that bug existed before this patch; it was just exposed with the additional tests. Ie, because the library raises an exception on atan2(0, 0), we don't want to assume any particular constant-folded result.

A similar corner-case came up in the earlier comments: we avoid constant folding on 1-argument libm calls that potentially raise exceptions with a NaN/Inf input, but that check is missing on the path that handles 2-argument calls. And now we need a special-case for atan2 to bail out when both inputs are zero.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127964/new/

https://reviews.llvm.org/D127964



More information about the llvm-commits mailing list