Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable exp10 libcall on linux #68736

Merged
merged 8 commits into from
Mar 20, 2024
Merged

Enable exp10 libcall on linux #68736

merged 8 commits into from
Mar 20, 2024

Conversation

Krishna-13-cyber
Copy link
Contributor

No description provided.

@arsenm
Copy link
Contributor

arsenm commented Oct 27, 2023

@RKSimon should exp10/exp10f be available for -ps4/-ps5 triples?

@RKSimon
Copy link
Collaborator

RKSimon commented Oct 27, 2023

@RKSimon should exp10/exp10f be available for -ps4/-ps5 triples?

No

@@ -1,3 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to generated checks should be committed separately

@RKSimon RKSimon requested a review from pogo59 January 15, 2024 11:05
RKSimon added a commit that referenced this pull request Jan 15, 2024
Move to using update_test_checks script + cleanup check-prefixes.

Help simplify diff for #68736
@@ -139,9 +139,10 @@ define fp128 @powl_exp2l_not_fast(fp128 %x, fp128 %y) {
; TODO: exp10() is not widely enabled by many targets yet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update todo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
Move to using update_test_checks script + cleanup check-prefixes.

Help simplify diff for llvm#68736
Comment on lines 560 to 564
// exp10, exp10f, exp10l is available on Linux (GLIBC) but are extremely
// buggy prior to glibc version 2.18. Until this version is widely deployed
// or we have a reasonable detection strategy, we cannot use exp10 reliably
// on Linux.
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave some kind of historical note

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, thanks again!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just update the "Until this version is widely deployed or we have a reasonable detection strategy, we cannot use exp10 reliably" part to something about how this is so old it doesn't matter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"As this version is so old, we don't really need to worry about using exp10 until we find more good ways to detect it."

Does this look fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "until we find more good ways to detect it." reads off. Can drop it or rephrase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will drop this.

Copy link

github-actions bot commented Mar 1, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@arsenm
Copy link
Contributor

arsenm commented Mar 6, 2024

Bot failure is real

@arsenm arsenm merged commit 9848fa4 into llvm:main Mar 20, 2024
4 checks passed
//
// Fall through to disable all of them.
[[fallthrough]];
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change here caused a quite noisy warning from GCC:

../lib/Analysis/TargetLibraryInfo.cpp: In function ‘void initialize(llvm::TargetLibraryInfoImpl&, const llvm::Triple&, llvm::ArrayRef<llvm::StringLiteral>)’:
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘UnknownOS’ not handled in switch [-Wswitch]
  533 |   switch (T.getOS()) {
      |          ^
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘Darwin’ not handled in switch [-Wswitch]
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘DragonFly’ not handled in switch [-Wswitch]
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘FreeBSD’ not handled in switch [-Wswitch]
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘Fuchsia’ not handled in switch [-Wswitch]
../lib/Analysis/TargetLibraryInfo.cpp:533:10: warning: enumeration value ‘KFreeBSD’ not handled in switch [-Wswitch]

(and so on for all OSes known by Triple)

So ideally we'd keep the default case to silence this compiler warning (or not enable -Wswitch, wherever that comes from).

@ecnelises
Copy link
Member

Should this patch has nothing to do with PS? I tried adding default: label back, but double-float-shrink-1.ll pow-1.ll pow-exp.ll fail. If I understand this path correctly, cases other than linux should not be affected.

nikic added a commit that referenced this pull request Mar 20, 2024
This reverts commit 9848fa4.

Causes buildbot failures.
@nikic
Copy link
Contributor

nikic commented Mar 20, 2024

I went ahead and reverted this change. I could have fixed the uncovered switch warning, but the change in general looks problematic to me.

The comment indicates that these functions are broken prior to glibc 2.18 -- however, a common glibc baseline for binary distribution is glibc 2.17, because it is used by CentOS/RHEL 7. This is the glibc baseline that Rust uses, for example. If you want to increase the glibc requirements of LLVM-generated binaries, then that needs a wider discussion than this pull request (or more research to show that this is safe, e.g. because distros using glibc 2.17 have backported the necessary fixes or so).

There are also some buildbots failing with undefined symbol: __exp10 after this change, for example https://lab.llvm.org/buildbot/#/builders/239/builds/6232.

chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
This reverts commit 9848fa4.

Causes buildbot failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants