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

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 14:05:00 PDT 2022


ro added a comment.

In D127964#3735654 <https://reviews.llvm.org/D127964#3735654>, @spatel wrote:

> 



> Thanks for checking. I added tests and avoided folding on these patterns:
> 4bff1037bbfc3 <https://reviews.llvm.org/rG4bff1037bbfc31d6ff588a19b41f7f7f76bdeefb>
> 7f1262a322c0 <https://reviews.llvm.org/rG7f1262a322c0d80f34964004dbd3ebec58404a5f>
>
> In the initial review, we misinterpreted the POSIX docs because the optional behavior specifier for raising errors is easily missed. If there are other cases where this patch overstepped, we should fix those too.

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):

  --- atan.ll.x86_64	2022-08-19 23:01:10.257646000 +0200
  +++ atan.ll.amd64	2022-08-19 23:00:57.605261000 +0200
  @@ -26,22 +26,22 @@
   
   define float @callatan2_00() {
     %call = call float @atan2f(float 0.000000e+00, float 0.000000e+00)
  -  ret float 0.000000e+00
  +  ret float %call
   }
   
   define float @callatan2_n00() {
     %call = call float @atan2f(float -0.000000e+00, float 0.000000e+00)
  -  ret float -0.000000e+00
  +  ret float %call
   }
   
   define float @callatan2_0n0() {
     %call = call float @atan2f(float 0.000000e+00, float -0.000000e+00)
  -  ret float 0x400921FB60000000
  +  ret float %call
   }
   
   define float @callatan2_n0n0() {
     %call = call float @atan2f(float -0.000000e+00, float -0.000000e+00)
  -  ret float 0xC00921FB60000000
  +  ret float %call
   }
   
   define float @callatan2_x0() {


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