llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[CodeGen][PowerPC] `atan2(double)` is incorrectly recognized as `atan2(double, double)`

Open ZERICO2005 opened this issue 2 months ago • 10 comments

It appears that double atan2(double) is incorrectly recognized as double atan2(double, double) in this test: https://github.com/llvm/llvm-project/blob/841433da7862a29bc1688ce7960c7ee349fa2973/llvm/test/CodeGen/PowerPC/lower-scalar-mass-fast.ll#L372-L379

Other two argument functions appear to be written correctly in that file.

TODO:

  • Fix the broken test to use the correct prototype for atan2
  • Add tests (in a separate file) to make sure that tail call nnan ninf afn nsz double @atan2(double %a) does not become __xl_atan2_finite.
  • Investigate if the libcall detection code should be fixed/modified for PowerPC, or if this extends beyond PowerPC.

ZERICO2005 avatar Sep 29 '26 19:09 ZERICO2005

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor is working on this issue. If someone is assigned to the issue or claimed to be working on it, ping the person. After one week without a response, the assignee may be changed.
  2. Leave a comment indicating that you are working on the issue, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally. Be aware that LLVM's AI policy forbids the use of AI tools to fix good first issues since it squanders a learning opportunity. Using LLMs to search and learn is permitted, since the goal is learning.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

@llvm/issue-subscribers-good-first-issue

Author: Eric Ross (ZERICO2005)

It appears that `double atan2(double)` is incorrectly recognized as `double atan2(double, double)` in this test: https://github.com/llvm/llvm-project/blob/841433da7862a29bc1688ce7960c7ee349fa2973/llvm/test/CodeGen/PowerPC/lower-scalar-mass-fast.ll#L372-L379

Other two argument functions appear to be written correctly in that file.

TODO:

  • Fix the broken test to use the correct prototype for atan2
  • Add tests (in a separate file) to make sure that tail call nnan ninf afn nsz double @<!-- -->atan2(double %a) does not become __xl_atan2_finite.
  • Investigate if the libcall detection code should be fixed/modified for PowerPC, or if this extends beyond PowerPC.

@llvm/issue-subscribers-backend-powerpc

Author: Eric Ross (ZERICO2005)

It appears that `double atan2(double)` is incorrectly recognized as `double atan2(double, double)` in this test: https://github.com/llvm/llvm-project/blob/841433da7862a29bc1688ce7960c7ee349fa2973/llvm/test/CodeGen/PowerPC/lower-scalar-mass-fast.ll#L372-L379

Other two argument functions appear to be written correctly in that file.

TODO:

  • Fix the broken test to use the correct prototype for atan2
  • Add tests (in a separate file) to make sure that tail call nnan ninf afn nsz double @<!-- -->atan2(double %a) does not become __xl_atan2_finite.
  • Investigate if the libcall detection code should be fixed/modified for PowerPC, or if this extends beyond PowerPC.

hi, can i work on this issue? is it available? please assign it to me.

sangam151 avatar Sep 29 '26 19:09 sangam151

I think I can work on this issue , if sangam151 u would like to cooperate

shourya990 avatar Sep 29 '26 19:09 shourya990

Hello @ZERICO2005 . While this has been assigned already, I dont see any updates here from the asignee since a week. I would like to work on this issue. I'll start looking into it and prepare a PR.

adiroy28852 avatar Oct 07 '26 18:10 adiroy28852

@sangam151 @shourya990 Are either of you still working on this issue?

ZERICO2005 avatar Oct 07 '26 18:10 ZERICO2005

@sangam151 @shourya990 Are either of you still working on this issue?

Yes, iam working on it...

sangam151 avatar Oct 08 '26 02:10 sangam151

Hi @ZERICO2005 If there is still no updates here, may I pick this up? I dont see any linked MRs, and would like to work on this Thanks

adiroy28852 avatar Oct 14 '26 16:10 adiroy28852

@sangam151 Could you open a draft PR or share your progress within the next few days (say, by Wednesday, October 21)? If there is no update by then, I'll reassign this to @adiroy28852, who has offered to pick it up.

ZERICO2005 avatar Oct 14 '26 16:10 ZERICO2005