<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Recently I've done some experiments on the LLVM/Clang code and discovered that many of our source files often include unnecessary header files. I wrote a simple tool that eliminates redundant includes and estimates benefits of doing it, and the results were quite nice: for some files we were able to save 90% of compile time! I think we want to apply some of the cleanups I found, but I'm not sure how to better do it: the total patches are 8k lines of code for LLVM and 3k lines of code for clang (I'll attach them for reference). My suggestion would be that people take a look at the list of changed files and pick the changes for the piece of code they are working on if the changes look sane (the changes do need some checking before committing). Does it sound like a good idea? I'd appreciate any feedback on what can we do here.</div><div class=""><br class=""></div><div class="">The list of files for which removing redundant headers improved compile time (the numbers are compile time in seconds for a Debug build):</div><div class=""><b class=""><br class=""></b></div><div class=""><b class="">LLVM top 10</b></div><div class=""><div class=""><font face="Menlo" style="font-size: 11px;" class=""><b class=""><u class="">Filename<span class="Apple-tab-span" style="white-space:pre"> </span>Old<span class="Apple-tab-span" style="white-space:pre"> </span>New<span class="Apple-tab-span" style="white-space:pre"> </span>Delta</u></b></font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/CodeGen/GlobalISel/GlobalISel.cpp<span class="Apple-tab-span" style="white-space: pre;"> </span>0.26<span class="Apple-tab-span" style="white-space:pre"> </span>0.02<span class="Apple-tab-span" style="white-space:pre"> </span>-91.9%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/MC/MCLabel.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.19<span class="Apple-tab-span" style="white-space:pre"> </span>0.02<span class="Apple-tab-span" style="white-space:pre"> </span>-88.2%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">tools/llvm-readobj/ObjDumper.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.43<span class="Apple-tab-span" style="white-space:pre"> </span>0.10<span class="Apple-tab-span" style="white-space:pre"> </span>-76.5%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/MC/MCWinEH.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.51<span class="Apple-tab-span" style="white-space:pre"> </span>0.13<span class="Apple-tab-span" style="white-space:pre"> </span>-74.3%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/Transforms/Vectorize/Vectorize.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.72<span class="Apple-tab-span" style="white-space:pre"> </span>0.29<span class="Apple-tab-span" style="white-space:pre"> </span>-59.7%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">tools/llvm-diff/DiffLog.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.58<span class="Apple-tab-span" style="white-space:pre"> </span>0.26<span class="Apple-tab-span" style="white-space:pre"> </span>-54.6%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.46<span class="Apple-tab-span" style="white-space:pre"> </span>0.26<span class="Apple-tab-span" style="white-space:pre"> </span>-44.1%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/DebugInfo/DWARF/DWARFExpression.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>0.68<span class="Apple-tab-span" style="white-space:pre"> </span>0.38<span class="Apple-tab-span" style="white-space:pre"> </span>-43.3%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/LTO/LTOModule.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>2.25<span class="Apple-tab-span" style="white-space:pre"> </span>1.33<span class="Apple-tab-span" style="white-space:pre"> </span>-41.1%</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">lib/Target/TargetMachine.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>1.76<span class="Apple-tab-span" style="white-space:pre"> </span>1.10<span class="Apple-tab-span" style="white-space:pre"> </span>-37.8%</font></div></div><div class=""><br class=""></div><div class="">Full list:</div><div class=""></div></body></html>