<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 15, 2017 at 10:58 AM, Mehdi AMINI via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2017-12-09 12:54 GMT-08:00 Chris Lattner via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span><br><blockquote type="cite"><div>On Dec 8, 2017, at 5:01 PM, Mikhail Zolotukhin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-9213035325196427625m_-5777518192889444194Apple-interchange-newline"><div><div style="word-wrap:break-word">Hi,<div><br></div><div>I tweaked my scripts to avoid removing includes when it doesn't give any significant benefits, which made the patches significantly smaller. This time the patches should not try to remove includes of header files, which are transitively included from other included header files. The gains mostly remained the same (plus/minus noise), the tables are in the end of the email. I also included size of preprocessed files (measured in 1000 lines of code).</div></div></div></blockquote><div><br></div></span><div>Just my opinion, but it is *good* to remove redundant header file includes, even if it doesn’t speed up the build.</div><div><a href="http://llvm.org/docs/CodingStandards.html#minimal-list-of-includes" target="_blank">http://llvm.org/docs/CodingSta<wbr>ndards.html#minimal-list-of-<wbr>includes</a></div></div></div></blockquote><div><br></div><div><br></div></span><div>Do you consider transitive includes as redundant? Why should we remove these?</div><div>One drawback I see with removing these is that if I need `class Foo` but I get it through `bar.h` which includes `foo.h`, it means that removing the include to `foo.h` in `bar.h` would break the client of bar that relied on this transitive includes.</div><div>That makes refactoring of a components harder since it may break some of the clients of the components for no other reason than this transitive include.</div><div>I suspect this is why IWYU would instead *add* these includes when they're missing.</div></div></div></div></blockquote><div><br></div><div>+1, relying on transitive includes is fragile.</div><div><br></div><div>In our fork, a random #include of raw_ostream.h snuck into APInt.h at one point. When I went to remove it (perhaps a few months after it was introduced), there were already a handful of files that were relying on it that were broken by my "remove debugging code that snuck in" change.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div></font></span><div><div class="h5"><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><div></div><br><blockquote type="cite"><div><span><div style="word-wrap:break-word"><div><br></div><div>I suggest that from here we go as follows: maintainers/interested people take a look at files related to their components and pick the parts of the patches that they consider correct. I'll also start with some files next week if there is no objections to it. Does it sound reasonable?</div><div><br></div><div>The most impacted files (the numbers are for Debug build):</div><div><br></div><div><b>LLVM top 10</b></div><div><div><b style="font-family:Menlo;font-size:11px"><u>Filename<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                                            </span>TimeOld<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>TimeNew<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>Delta<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span></u></b><b style="font-family:Menlo;font-size:11px"><u>SizeOld<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">   </span>SizeNew<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>SizeDelta</u></b></div><div><font face="Menlo" style="font-size:11px">lib/CodeGen/GlobalISel/GlobalI<wbr>Sel.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                   </span>0.26<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.02<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-91.6%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>35.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.3<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">        </span>-99.0%</font></div><div><font face="Menlo" style="font-size:11px">lib/MC/MCLabel.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                                   </span>0.20<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.02<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-88.0%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>25.5<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">        </span>-99.9%</font></div><div><font face="Menlo" style="font-size:11px">tools/llvm-readobj/ObjDumper.c<wbr>pp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                  </span>0.44<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.10<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-76.8%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>41.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>11.8<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-71.1%</font></div><div><font face="Menlo" style="font-size:11px">lib/MC/MCWinEH.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                                   </span>0.49<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.15<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-70.4%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>43.9<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>21.4<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-51.2%</font></div><div><font face="Menlo" style="font-size:11px">lib/Transforms/Vectorize/Vecto<wbr>rize.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                    </span>0.73<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.29<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-60.7%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>52.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>35.5<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-32.6%</font></div><div><font face="Menlo" style="font-size:11px">tools/llvm-diff/DiffLog.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                          </span>0.59<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.27<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-53.8%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>50.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>33.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-33.7%</font></div><div><font face="Menlo" style="font-size:11px">lib/Target/ARM/MCTargetDesc/AR<wbr>MMachORelocationInfo.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>0.47<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.25<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-46.7%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>46.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>37.9<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-18.9%</font></div><div><font face="Menlo" style="font-size:11px">lib/DebugInfo/DWARF/DWARFExpre<wbr>ssion.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                   </span>0.67<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.38<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-43.5%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>47.4<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>34.8<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-26.7%</font></div><div><font face="Menlo" style="font-size:11px">lib/Transforms/Utils/ASanStack<wbr>FrameLayout.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">             </span>0.52<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.32<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-38.8%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>41.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>33.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-19.2%</font></div><div><font face="Menlo" style="font-size:11px">tools/llvm-dwp/llvm-dwp.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                          </span>2.48<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>1.53<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-38.3%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>92.5<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>55.2<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-40.3%</font></div><div><br></div><div>Full list:</div><div></div></div></div></span><span id="m_-9213035325196427625m_-5777518192889444194cid:5E5AAC28-D0FA-48BD-8493-BF1EBAE6178B@wp.comcast.net"><llvm.txt></span><div style="word-wrap:break-word"><div><div></div><div><br></div><div><b>Clang top 10</b></div><div><span><div><b style="font-family:Menlo;font-size:11px"><u>Filename<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                                                </span>TimeOld<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>TimeNew<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>Delta<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>SizeOld<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>SizeNew<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">    </span>SizeDelta</u></b></div></span><div><span style="font-size:11px"><font face="Menlo">tools/libclang/CXString.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                               </span>2.25<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.30<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-86.9%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>85.1<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>31.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-62.7%</font></span></div><div><span style="font-size:11px"><font face="Menlo">lib/Tooling/CommonOptionsParse<wbr>r.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                      </span>2.33<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.68<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-70.6%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>87.1<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>34.4<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-60.5%</font></span></div><div><span style="font-size:11px"><font face="Menlo">lib/AST/StmtViz.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                                 </span>1.28<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.48<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-62.5%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>62.4<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>39.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-37.5%</font></span></div><div><span style="font-size:11px"><font face="Menlo">tools/driver/cc1_main.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                           </span>3.05<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>1.29<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-57.8%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>93.7<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>58.6<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-37.4%</font></span></div><div><span style="font-size:11px"><font face="Menlo">unittests/CodeGen/BufferSource<wbr>Test.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                   </span>4.12<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>2.62<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-36.5%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>145.8<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>103.9<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>-28.7%</font></span></div><div><span style="font-size:11px"><font face="Menlo">lib/CodeGen/CGLoopInfo.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                          </span>2.43<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>1.68<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-30.7%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>101.6<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>82.5<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-18.8%</font></span></div><div><span style="font-size:11px"><font face="Menlo">unittests/CodeGen/CodeGenExter<wbr>nalTest.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                </span>4.50<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>3.21<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-28.6%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>155.5<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>125.1<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>-19.5%</font></span></div><div><span style="font-size:11px"><font face="Menlo">lib/Driver/ToolChains/Contiki.<wbr>cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                        </span>0.53<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>0.38<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-28.1%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>42.4<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>38.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-10.5%</font></span></div><div><span style="font-size:11px"><font face="Menlo">unittests/Tooling/RefactoringA<wbr>ctionRulesTest.cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap"> </span>3.22<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>2.34<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-27.5%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>108.3<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">      </span>90.0<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-16.9%</font></span></div><div><span style="font-size:11px"><font face="Menlo">lib/Serialization/GeneratePCH.<wbr>cpp<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">                        </span>2.38<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>1.78<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-25.1%<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">     </span>83.8<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>71.1<span class="m_-9213035325196427625m_-5777518192889444194Apple-tab-span" style="white-space:pre-wrap">       </span>-15.1%</font></span></div></div><div><br></div><div>Full list:</div><div></div></div></div><span id="m_-9213035325196427625m_-5777518192889444194cid:3779124B-B6AC-4246-B303-A9C10637540B@wp.comcast.net"><clang.txt></span><div style="word-wrap:break-word"><div><div></div><div><br></div><div><br></div><div>The updated patches:</div><div></div></div></div>
<span id="m_-9213035325196427625m_-5777518192889444194cid:CA6621F4-DA98-4F50-85F1-D36AA08C384E@wp.comcast.net"><llvm_redundant_headers.patch></span><div style="word-wrap:break-word"><div><div></div></div></div>
<span id="m_-9213035325196427625m_-5777518192889444194cid:1EB43E2E-1C9F-41C4-8766-759D37E3AA8A@wp.comcast.net"><clang_redundant_headers.patch<wbr>></span><div style="word-wrap:break-word"><div><div></div><div><br></div><div>Thanks,</div><div>Michael</div><div><div class="m_-9213035325196427625h5"><div><br><div><blockquote type="cite"><div>On Dec 8, 2017, at 9:20 AM, Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-9213035325196427625m_-5777518192889444194Apple-interchange-newline"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="m_-9213035325196427625m_-5777518192889444194Apple-interchange-newline"><br><blockquote type="cite"><div>On Dec 6, 2017, at 1:17 PM, Matthias Braun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-9213035325196427625m_-5777518192889444194Apple-interchange-newline"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- We do indeed have a lot of unnecessary includes around in llvm (or pretty much any other C++ project for that matter).</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- I want faster builds.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- The only way to reliably fight this is indeed automatic tools.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- Having the right amount of includes also has documentation value and ideally let's you understand the structure of your project.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- However relying on transitive includes works contrary to the last "undestanding/documentation" point.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- (And as stated earlier to have things really clean we want `class XXX;` instead of `#include "XXX.h"` wherever possible. And if you are serious about that we also often have to reduce the amount of include code in the headers so we can move the `#include "XXX.h"` from the header to the implementation.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">For me personally I think the documentation/understandabilit<wbr>y we loose when relying on transitive includes weights heavier than my desire to get a faster build…</div></div></blockquote><div><br></div><div>+1</div><div><br></div><div>Q.</div><br><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">- Matthias</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br><blockquote type="cite"><div>On Dec 6, 2017, at 12:28 PM, serge guelton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-9213035325196427625m_-5777518192889444194Apple-interchange-newline"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">On Wed, Dec 06, 2017 at 11:38:54AM -0800, Michael Zolotukhin via llvm-dev wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br><blockquote type="cite">On Dec 6, 2017, at 9:00 AM, mats petersson via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br><br>In my experience, a lot of time is spent on optimizing the code (assuming it's not a "-O0" build).<br></blockquote>The numbers were actually for the debug build (-O0 -g), so for Release build they would be different (presumably lower).<br><blockquote type="cite">Also redundant includes are largely fixed by header guards, and I believe Clang [and gcc as well as MS Compilers, and probably most others too] have an include guards-cache that determines that "we've already included foo.h, and it has include guards around the whole actual content of the file, so we can just skip it”.<br></blockquote>By redundant here I meant that we included a file, but we didn’t use any of its content (rather than we included the same file twice).<br><blockquote type="cite"><br>So I'm slightly dubious as to this being an efficient way of significantly reducing the total compilation time for the overall project - even if there are SOME cases where there is a significant improvement in a single file. The total time for a clean build [in wall-clock-time, not CPU-time] should be measured, making sure that there is enough memory. Doing a run of, say, five complete builds of the same thing [with suitable "clean" between to redo the whole build], take away the worst and the best, and perhaps also "modify one of the more common header files" (llvm/IR/Type.h for example) and build again.<br></blockquote>On full builds the benefit is not big (around 1%, but the noise is high), but: 1) if we only take gains more than, say, 5%, we’ll probably never see any, 2) I aim at changes that make the code strictly better (modulo David’s point about disk cache). If any change is questionable from maintenance or whatever other point of view, I’m all for dropping it.<br></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">my 2¢</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">+1 for point 2). Even leaving aside the speed gain, removing unused</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">includes file just looks like good coding practice to me.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a></div></blockquote></div><br></div></div></div></div></div><div><div class="m_-9213035325196427625h5">______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></div></div></blockquote></div><br></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>