[PATCH] D28499: SimplifyLibCalls: Replace copysign calls with intrinsic

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 19:57:12 PST 2017

hfinkel added a comment.

I think that most of this looks good, except as noted below...

Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1423
+    // Do binary FP operation on smaller type.
+    // (fptrunc (copysign x, y)) -> (copysign (fptrunc x), (fptrunc y))
+    Value *Trunc0 = Builder->CreateFPTrunc(II->getArgOperand(0), Ty);
I think this should be done in DAGCombine. It is not clear to me that this is always beneficial nor does it clearly make a useful canonical form. I think we should canonicalize the other way: it seems simpler.


More information about the llvm-commits mailing list