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

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 03:36:01 PST 2022


pengfei updated this revision to Diff 484521.
pengfei marked an inline comment as done.
pengfei added a comment.

Use FastMathFlagGuard instead, thanks @foad!

In D140467#4010296 <https://reviews.llvm.org/D140467#4010296>, @arsenm wrote:

> Needs tests. I couldn’t find any for the base builtins either

I don't think so. We have tested their intrinsic wrappers, e.g., https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/X86/avx512fp16-builtins.c#L4451

We don't need to test those target specific builtins. They are neither guaranteed to be cross compiler compatible nor release by release.

Besides, we have thousands of intrinsics in X86. Adding their builtin tests have no any benefits and increase the time in lit tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140467

Files:
  clang/lib/CodeGen/CGBuiltin.cpp


Index: clang/lib/CodeGen/CGBuiltin.cpp
===================================================================
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -13113,6 +13113,8 @@
     return Builder.CreateBitCast(Sext, FPVecTy);
   };
 
+  IRBuilder<>::FastMathFlagGuard FMFGuard(Builder);
+
   switch (BuiltinID) {
   default: return nullptr;
   case X86::BI_mm_prefetch: {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140467.484521.patch
Type: text/x-patch
Size: 399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221221/34d82703/attachment.bin>


More information about the cfe-commits mailing list