[PATCH] D91673: [PGO] Enable preinline and cleanup when optimize for size

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 18:03:13 PST 2020


zequanwu created this revision.
zequanwu added reviewers: xur, davidxl, rnk.
Herald added subscribers: cfe-commits, wenlei.
Herald added a project: clang.
zequanwu requested review of this revision.

This is intended to reduce the binary size of both phase 1 and phase 2 builds.
By compiling chrome on Windows (using -Os in both phases), the binary size of phase 1 is reduced by 27.5% and binary size of phase 2 is reduced by 8.4%.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91673

Files:
  clang/lib/Frontend/InitPreprocessor.cpp


Index: clang/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -403,6 +403,11 @@
     Builder.defineMacro("__STDCPP_DEFAULT_NEW_ALIGNMENT__",
                         Twine(TI.getNewAlign() / TI.getCharWidth()) +
                             TI.getTypeConstantSuffix(TI.getSizeType()));
+
+    //   -- __STDCPP_­THREADS__
+    //      Defined, and has the value integer literal 1, if and only if a
+    //      program can have more than one thread of execution.
+    Builder.defineMacro("__STDCPP_­THREADS__", "1");
   }
 
   // In C11 these are environment macros. In C++11 they are only defined


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91673.305946.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201118/546eaed0/attachment.bin>


More information about the cfe-commits mailing list