[llvm] [mlir] Shard the public llvm-config.h in multiple files (NFC) (PR #71273)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 08:15:41 PST 2023


joker-eph wrote:

> I think the important point here is that you need to justify why this is an improvement

Well I am claiming this is a cleanup: which is subjective, but just as much as a lot of software engineer is (hey you started with a lot of "subjective" claims!). Can make it less subjective by claiming separation of concerns and modularity: which is actually measurable. 

 > Do you have performance numbers to show that this speeds up builds in some configuration? 
 
Note that this patch alone does not change anything: because I need to update all the users first and stop including llvm-config.h, which is a series of follow-up cleanup patches.

But the impacts seemed obvious to me, let me actually give numbers, it is fairly easily collect them:

 - There are 25 files which uses LLVM_VERSION_*, yet the LLVM_VERSION_ macro impacts all the files which transitively include llvm-config.h (that is ~ all of the project?). So including LLVM_VERSION where it's used will reduce by O(100-1000) the number of compilation commands affected.
 - LLVM_ENABLE_CURL is used in 2 files, but the macro impacts all the files including `llvm-config.h` transitively, so that is again a factor of O(1000) reduction. 
 - ... (I can continue to grep, but think it'll be the same for all of these?)
 
For example, switching the LLVM_ENABLE_CURL ON/OFF config, on one build config (not including flang/clang) it means 5126 targets to rebuild before, and only 20 after (this is what I observe with `ninja` locally in practice).

https://github.com/llvm/llvm-project/pull/71273


More information about the llvm-commits mailing list