[PATCH] D28030: [TLI] Add prototype checking for all remaining LibFuncs.
Ahmed Bougacha via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 11:45:06 PST 2017
ab marked 6 inline comments as done.
ab added inline comments.
================
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));
+
----------------
ab wrote:
> 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?
On second thought, I generalized these to isIntegerTy(). While I think it's a reasonable assumption to make for clang, it's much less so for TLI. More importantly, I skimmed a couple of my old TLI consolidation commits and didn't find i32 requirements.
https://reviews.llvm.org/D28030
More information about the llvm-commits
mailing list