[PATCH] D40299: [Complex] Don't use __div?c3 when building with fast-math.

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 14 16:31:22 PST 2017


hfinkel added inline comments.


================
Comment at: lib/CodeGen/CGExprComplex.cpp:773
     // supported imaginary types in addition to complex types.
-    if (RHSi) {
+    if (RHSi && !FMF.isFast()) {
       BinOpInfo LibCallOp = Op;
----------------
fhahn wrote:
> Would the following structure be slightly easier to read?
> 
> if (RHSi) {
>   if (FMF.isFast()) { simplify } else {libcall}
> }
I'd use CGF.getLangOpts().FastMath (instead of interrogating the implicit state stored in the IR builder).


================
Comment at: test/CodeGen/complex-math.c:134
+  // FASTMATH-NOT: @__divsc3
+  // FASTMATH: fdiv
+  // FASTMATH: fdiv
----------------
Please check the actual expansion here and below.


https://reviews.llvm.org/D40299





More information about the cfe-commits mailing list