[PATCH] D28030: [TLI] Add prototype checking for all remaining LibFuncs.

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 17:15:46 PST 2017


ab marked 4 inline comments as done.
ab added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:747
+  case LibFunc::ZdaPv:
+  case LibFunc::ZdlPv:
   case LibFunc::chmod:
----------------
efriedma wrote:
> You could probably check these a bit more precisely.
That's true of a good portion of these libfuncs;  I'm trying to fix it gradually!  For that matter, some probably aren't even used anywhere in LLVM and should be removed.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:1075-1081
+  case LibFunc::ldexp:
+  case LibFunc::ldexpf:
+  case LibFunc::ldexpl:
+    return (NumParams == 2 && FTy.getReturnType()->isFloatingPointTy() &&
+            FTy.getReturnType() == FTy.getParamType(0) &&
+            FTy.getParamType(1)->isIntegerTy(32));
+
----------------
davide wrote:
> Are you sure `isIntegerTy(32)` is correct? In other words, is always correct to assume that an int is `32-bit` ?
I'm not sure, for 'int' or for any other C type ('char' is probably the only type for which LLVM already pervasively assumes a specific width).

I wouldn't be opposed to relaxing the checks;  do you have a platform in mind?


https://reviews.llvm.org/D28030





More information about the llvm-commits mailing list