[flang-commits] [flang] Reduce memory consumption when compiling flang (PR #124919)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Wed Jan 29 05:19:46 PST 2025
kparzysz wrote:
Moving all template instantiations from Lower/Support/Utils.h to Lower/Support/Utils.cpp reduced peak memory use when compiling OpenMP.cpp (on my machine) from 4.9g to 3.7g.
The change was to only leave template declarations in the header file and explicitly instantiate every case that was previously instantiated implicitly. If a new implicit instantiation appears later on, it will cause a compilation error (and the explicit instantiation will need to be added manually). The change lists all instantiations explicitly, but it could likely be shortened using macros.
https://github.com/llvm/llvm-project/pull/124919
More information about the flang-commits
mailing list