[flang-commits] [flang] 0c5eb4d - [flang] Use precompiled parsing headers (#130600)

via flang-commits flang-commits at lists.llvm.org
Thu Mar 13 03:28:35 PDT 2025


Author: Kajetan Puchalski
Date: 2025-03-13T10:28:31Z
New Revision: 0c5eb4d68b0992f6934fead1af3474aac672f5e4

URL: https://github.com/llvm/llvm-project/commit/0c5eb4d68b0992f6934fead1af3474aac672f5e4
DIFF: https://github.com/llvm/llvm-project/commit/0c5eb4d68b0992f6934fead1af3474aac672f5e4.diff

LOG: [flang] Use precompiled parsing headers (#130600)

Most of the high memory usage and compilation time in the frontend units
is due to including large parsing headers.
This commit moves out several of the largest parsing headers into a new
precompiled header linked to flangFrontend.
The new compilation metrics for FrontendActions.cpp are as follows:

User time (seconds): 38.40
System time (seconds): 2.00
Maximum resident set size (kbytes): 2710964 (2.58 GB) (vs 3.78 GB)

ParserActions.cpp:

User time (seconds): 69.37
System time (seconds): 1.81
Maximum resident set size (kbytes): 2599456 (2.47 GB) (vs 4 GB)

Alongside the new precompiled header compilation unit

User time (seconds): 41.61
System time (seconds): 2.72
Maximum resident set size (kbytes): 3107644 (2.96 GB)

---------

Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>

Added: 
    

Modified: 
    flang/lib/Frontend/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/lib/Frontend/CMakeLists.txt b/flang/lib/Frontend/CMakeLists.txt
index c80373799b015..e8a098613e26f 100644
--- a/flang/lib/Frontend/CMakeLists.txt
+++ b/flang/lib/Frontend/CMakeLists.txt
@@ -72,3 +72,11 @@ add_flang_library(flangFrontend
   clangBasic
   clangDriver
 )
+
+target_precompile_headers(flangFrontend PRIVATE
+  [["flang/Parser/parsing.h"]]
+  [["flang/Parser/parse-tree.h"]]
+  [["flang/Parser/dump-parse-tree.h"]]
+  [["flang/Lower/PFTBuilder.h"]]
+  [["flang/Lower/Bridge.h"]]
+)


        


More information about the flang-commits mailing list