[PATCH] D11866: transform fmin/fmax calls when possible (PR24314)

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 02:57:34 PDT 2015


hfinkel 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);
----------------
You still need to check TLI->has(LibFunc::*) for the function itself. Maybe you want to make a hasBinaryFloatFn (like the existing hasUnaryFloatFn)?



http://reviews.llvm.org/D11866





More information about the llvm-commits mailing list