[PATCH] D67199: [InstCombine] Expand the simplification of log()

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 13:38:10 PDT 2019


craig.topper added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp:1923
+  LibFunc ArgLb = NotLibFunc;
+  TLI->getLibFunc(ArgNm, ArgLb);
+
----------------
evandro wrote:
> efriedma wrote:
> > This should be using the overload of getLibFunc that takes a CallSite, instead of expanding it out by hand.  This formulation skips checks that should happen otherwise (specifically, that it's not an indirect call, that the call isn't marked nobuiltin, and the function has an appropriate signature).
> True, but, as @craig.topper said, the cast at line 1919 above might be returning `nullptr`.
The CallSite version specifically checks that getCalledFunction doesn't return null. Because the case where it returns null is for an indirect call.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67199/new/

https://reviews.llvm.org/D67199





More information about the llvm-commits mailing list