[PATCH] D53338: [InstCombine] Cleanup libfunc attribute inferring

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 16 14:10:08 PDT 2018


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/Utils/BuildLibCalls.cpp:126
                                   const TargetLibraryInfo &TLI) {
-  if (!Func)
+  if (!M)
     return false;
----------------
We can safely assume the module is non-null.


================
Comment at: lib/Transforms/Utils/BuildLibCalls.cpp:862
   CallInst *CI = B.CreateCall(
-      StrNCpy, {castToCStr(Dst, B), castToCStr(Src, B), Len}, "strncpy");
+      StrNCpy, {castToCStr(Dst, B), castToCStr(Src, B), Len}, Name);
   if (const Function *F = dyn_cast<Function>(StrNCpy->stripPointerCasts()))
----------------
We should probably clean this up to compute the name using TargetLibraryInfo at some point, but it's okay to leave it for now.


Repository:
  rL LLVM

https://reviews.llvm.org/D53338





More information about the llvm-commits mailing list