[llvm] Enable exp10 libcall on linux (PR #68736)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 00:47:07 PDT 2024


================
@@ -558,16 +558,12 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
     break;
   case Triple::Linux:
     // 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.
-    //
-    // Fall through to disable all of them.
-    [[fallthrough]];
-  default:
----------------
mstorsjo wrote:

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

https://github.com/llvm/llvm-project/pull/68736


More information about the llvm-commits mailing list