[PATCH] D11866: transform fmin/fmax calls when possible (PR24314)
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 13:15:29 PDT 2015
spatel added inline comments.
================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1233
@@ +1232,3 @@
+ Value *Op1 = CI->getArgOperand(1);
+ Value *Cmp = Callee->getName().startswith("fmin") ?
+ B.CreateFCmpOLT(Op0, Op1) : B.CreateFCmpOGT(Op0, Op1);
----------------
hfinkel wrote:
> You still need to check TLI->has(LibFunc::*) for the function itself. Maybe you want to make a hasBinaryFloatFn (like the existing hasUnaryFloatFn)?
>
Sorry, I'm not understanding. We're replacing the call with regular instructions if we get this far, so there's no new library function to check. We check that the original code has this LibFunc before entering optimizeFMinMax(). Do we want to assert that or is there something else to check?
http://reviews.llvm.org/D11866
More information about the llvm-commits
mailing list