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

Paul Walker via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 07:52:50 PST 2017


paulwalker-arm marked 3 inline comments as done.
paulwalker-arm 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;
----------------
hfinkel wrote:
> 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).
Probably subjective but in this instance I preferred the look with fewer nested conditionals.


https://reviews.llvm.org/D40299





More information about the cfe-commits mailing list