[PATCH] D31806: [SimplifyLibCalls] Fix infinite loop with fast-math optimization.

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 18:53:02 PDT 2017


andrewng added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:945
+      if (FT->getReturnType()->isFloatTy() && (FT->getNumParams() == 1) &&
+          FT->getParamType(0)->isFloatTy())
+        return nullptr;
----------------
efriedma wrote:
> andrewng wrote:
> > efriedma wrote:
> > > The FunctionType check doesn't seem necessary here.
> > Wouldn't this be more correct? There's always the remote possibility that someone might have a function named expf with a different signature that calls exp.
> In that case, we're not only calling the wrong expf, we're calling it with the wrong signature, so we still would want to suppress the transform.
Yes, of course! Sorry, completely forgot about name mangling and was thinking C++ source function names.


https://reviews.llvm.org/D31806





More information about the llvm-commits mailing list