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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 05:15:39 PDT 2022


spatel added a comment.

In D127964#3709349 <https://reviews.llvm.org/D127964#3709349>, @mohammed-nurulhoque wrote:

>> There's an open question about what to do with denormals. We recently added denorm-attribute-aware folding with:
>> D116952 <https://reviews.llvm.org/D116952>
>> D128647 <https://reviews.llvm.org/D128647>
>> ...and we mentioned that it is a work-in-progress to get consistent behavior for intrinsics and libcalls. Exclude denorm inputs in this patch?
>
> The denormal question will affect the exact constant that will be substituted for the call, but it doesn't affect whether atan/atan2 is free from side-effects, no?
> This patch only changes whether atan/atan2 is safe to remove, it doesn't change how we substitute constants.

Denorms are mentioned specifically in the POSIX doc cited in an earlier comment:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atan.html

>   These functions may fail if
>   Range Error
>     [MX] [Option Start] The value of x is subnormal. 

But you're proposing that we take the permissive side of "may fail", so I guess that's fine. Please add test comments to make that clear.


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

https://reviews.llvm.org/D127964



More information about the llvm-commits mailing list