Created attachment 924242 [details] flang build log (.xz) with -ftime-report As discussed on IRC, when compiling llvm-core/flang, GCC may end up using ~10G for some files (effectively capping the package at -j3 on systems with 32G RAM).
The most memory consuming file is: [308/370] /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/llvm-core/flang-21.0.0_pre20250405/work/flang_build/lib/Lower -I/var/tmp/portage/llvm-core/flang-21.0.0_pre20250405/work/flang/lib/Lower -I/var/tmp/portage/llvm-core/flang-21.0.0_pre20250405/work/flang/include -I/var/tmp/portage/llvm-core/flang-21.0.0_pre20250405/work/flang_build/include -isystem /usr/lib/llvm/21/include -march=znver2 --param=l1-cache-size=32 --param=l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -ftime-report -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -std=c++17 -D_GNU_SOURCE -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -UNDEBUG -MD -MT lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o -MF lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o.d -o lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o -c /var/tmp/portage/llvm-core/flang-21.0.0_pre20250405/work/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp Some excerpts from memory report (it doesn't fit in a comment): Time variable usr sys wall GGC phase setup : 0.00 ( 0%) 0.01 ( 0%) 0.01 ( 0%) 2036k ( 0%) phase parsing : 17.49 ( 17%) 14.76 ( 26%) 32.36 ( 20%) 2585M ( 25%) phase lang. deferred : 37.94 ( 37%) 16.08 ( 28%) 54.21 ( 34%) 4046M ( 39%) phase opt and generate : 46.69 ( 46%) 26.00 ( 46%) 73.78 ( 46%) 3661M ( 36%) |name lookup : 7.24 ( 7%) 5.28 ( 9%) 12.34 ( 8%) 124M ( 1%) |overload resolution : 24.69 ( 24%) 13.45 ( 24%) 37.56 ( 23%) 2668M ( 26%) garbage collection : 7.38 ( 7%) 0.01 ( 0%) 7.42 ( 5%) 0 ( 0%) dump files : 3.24 ( 3%) 2.88 ( 5%) 6.14 ( 4%) 0 ( 0%) callgraph construction : 6.89 ( 7%) 1.40 ( 2%) 9.01 ( 6%) 729M ( 7%) callgraph optimization : 4.14 ( 4%) 4.02 ( 7%) 8.94 ( 6%) 931k ( 0%) callgraph functions expansion : 14.84 ( 15%) 3.49 ( 6%) 18.40 ( 11%) 539M ( 5%) callgraph ipa passes : 23.55 ( 23%) 19.54 ( 34%) 43.30 ( 27%) 1941M ( 19%) […] template instantiation : 36.28 ( 36%) 22.52 ( 40%) 59.38 ( 37%) 5152M ( 50%) constant expression evaluation : 5.41 ( 5%) 1.90 ( 3%) 7.30 ( 5%) 564M ( 5%) early inlining heuristics : 0.69 ( 1%) 0.62 ( 1%) 1.26 ( 1%) 20M ( 0%) inline parameters : 0.84 ( 1%) 0.58 ( 1%) 1.65 ( 1%) 171M ( 2%) integration : 2.79 ( 3%) 1.82 ( 3%) 5.13 ( 3%) 1144M ( 11%) […] TOTAL : 102.12 56.85 160.36 10295M Note 50% spent in templates.
Created attachment 924243 [details] DataSharingProcessor.cpp.ii.xz