[PATCH] D45180: libcalls must check for "RtLibUseGOT" metadata during simplification

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 16:55:20 PDT 2018


tmsriram added inline comments.


================
Comment at: lib/Transforms/Utils/BuildLibCalls.cpp:991
   if (File->getType()->isPointerTy())
-    inferLibFuncAttributes(*M->getFunction("fputc"), *TLI);
+    inferLibFuncAttributes(*M->getFunction("fputc"), *TLI, M);
   Char = B.CreateIntCast(Char, B.getInt32Ty(), /*isSigned*/true,
----------------
efriedma wrote:
> The "if (File->getType()->isPointerTy())" here is suspicious... I think we always need to honor the RtLibUseGOT metadata?
Good catch, thanks!  Looking at the other functions only the F{PutS, Putc,Write}  functions have this where it is safe to tag the param values with no capture.  When would this condition  File->getType()->isPointerTy() be false?  


https://reviews.llvm.org/D45180





More information about the llvm-commits mailing list