[PATCH] D140467: [X86][Reduce] Preserve fast math flags when change it. NFCI

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 01:25:39 PST 2022


barannikov88 added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:14742
     Builder.getFastMathFlags().setAllowReassoc();
-    return Builder.CreateCall(F, {Ops[0], Ops[1]});
+    Value *FAdd = Builder.CreateCall(F, {Ops[0], Ops[1]});
+    Builder.getFastMathFlags() &= (FMF);
----------------
barannikov88 wrote:
> Could be just:
> ```
>     return Builder.CreateCall(F, {Ops[0], Ops[1]})
>         ->getFastMathFlags()
>         .setAllowReassoc();
> ```
> so that you don't have to save and restore Builder's flags.
> 
No, it couldn't be, just tried :(


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140467/new/

https://reviews.llvm.org/D140467



More information about the cfe-commits mailing list