<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 15, 2017, at 12:45 PM, Michael Zolotukhin <<a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><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; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline"><br class=""><blockquote type="cite" class=""><div class="">On Dec 15, 2017, at 10:58 AM, Mehdi AMINI <<a href="mailto:joker.eph@gmail.com" class="">joker.eph@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br class="" 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; -webkit-text-stroke-width: 0px;"><div class="gmail_quote" 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; -webkit-text-stroke-width: 0px;">2017-12-09 12:54 GMT-08:00 Chris Lattner via llvm-dev<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word; line-break: after-white-space;"><br class=""><div class=""><span class=""><br class=""><blockquote type="cite" class=""><div class="">On Dec 8, 2017, at 5:01 PM, Mikhail Zolotukhin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-5777518192889444194Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word;">Hi,<div class=""><br class=""></div><div class="">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 class=""><br class=""></div></span><div class="">Just my opinion, but it is *good* to remove redundant header file includes, even if it doesn’t speed up the build.</div><div class=""><a href="http://llvm.org/docs/CodingStandards.html#minimal-list-of-includes" target="_blank" class="">http://llvm.org/docs/<wbr class="">CodingStandards.html#minimal-<wbr class="">list-of-includes</a></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Do you consider transitive includes as redundant? Why should we remove these?</div></div></div></blockquote><div class="">Hi Mehdi,</div><div class=""><br class=""></div>I don’t consider them redundant, and in the patches I’ve recently committed there shouldn’t be such removals - if you spot any, please let me know.</div></div></blockquote>For the record, they were committed in r320617-r320636 with a couple of follow-ups in r320645 and r320648. The clang part isn’t committed yet.</div><div><br class=""></div><div>Michael<br class=""><blockquote type="cite" class=""><div class=""><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; -webkit-text-stroke-width: 0px;" class=""> All your arguments (as well as mentioned earlier by other people) are completely valid.</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; -webkit-text-stroke-width: 0px;" class=""><br class=""></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; -webkit-text-stroke-width: 0px;" class="">Thanks,</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; -webkit-text-stroke-width: 0px;" class="">Michael<br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" 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; -webkit-text-stroke-width: 0px;"><div class="">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 class="">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 class="">I suspect this is why IWYU would instead *add* these includes when they're missing.</div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word; line-break: after-white-space;"><div class=""><div class=""></div><br class=""><blockquote type="cite" class=""><div class=""><span class=""><div class="" style="word-wrap: break-word;"><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">The most impacted files (the numbers are for Debug build):</div><div class=""><br class=""></div><div class=""><b class="">LLVM top 10</b></div><div class=""><div class=""><b class="" style="font-family: Menlo; font-size: 11px;"><u class="">Filename<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                                </span>TimeOld<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>TimeNew<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>Delta<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span></u></b><b class="" style="font-family: Menlo; font-size: 11px;"><u class="">SizeOld<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">     </span>SizeNew<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>SizeDelta</u></b></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/CodeGen/GlobalISel/<wbr class="">GlobalISel.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                    </span>0.26<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.02<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-91.6%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>35.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.3<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">    </span>-99.0%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/MC/MCLabel.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                       </span>0.20<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.02<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-88.0%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>25.5<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">    </span>-99.9%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">tools/llvm-readobj/ObjDumper.<wbr class="">cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                   </span>0.44<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.10<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-76.8%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>41.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>11.8<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-71.1%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/MC/MCWinEH.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                       </span>0.49<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.15<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-70.4%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>43.9<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>21.4<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-51.2%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/Transforms/Vectorize/<wbr class="">Vectorize.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                     </span>0.73<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.29<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-60.7%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>52.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>35.5<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-32.6%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">tools/llvm-diff/DiffLog.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                              </span>0.59<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.27<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-53.8%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>50.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>33.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-33.7%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/Target/ARM/MCTargetDesc/<wbr class="">ARMMachORelocationInfo.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">     </span>0.47<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.25<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-46.7%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>46.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>37.9<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-18.9%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/DebugInfo/DWARF/<wbr class="">DWARFExpression.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                    </span>0.67<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.38<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-43.5%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>47.4<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>34.8<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-26.7%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">lib/Transforms/Utils/<wbr class="">ASanStackFrameLayout.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">              </span>0.52<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.32<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-38.8%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>41.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>33.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-19.2%</font></div><div class=""><font face="Menlo" class="" style="font-size: 11px;">tools/llvm-dwp/llvm-dwp.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                              </span>2.48<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>1.53<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-38.3%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>92.5<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>55.2<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-40.3%</font></div><div class=""><br class=""></div><div class="">Full list:</div><div class=""></div></div></div></span><span id="m_-5777518192889444194cid:5E5AAC28-D0FA-48BD-8493-BF1EBAE6178B@wp.comcast.net" class=""><llvm.txt></span><div class="" style="word-wrap: break-word;"><div class=""><div class=""></div><div class=""><br class=""></div><div class=""><b class="">Clang top 10</b></div><div class=""><span class=""><div class=""><b class="" style="font-family: Menlo; font-size: 11px;"><u class="">Filename<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                         </span>TimeOld<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>TimeNew<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>Delta<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>SizeOld<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>SizeNew<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">        </span>SizeDelta</u></b></div></span><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">tools/libclang/CXString.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                </span>2.25<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.30<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-86.9%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>85.1<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>31.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-62.7%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">lib/Tooling/<wbr class="">CommonOptionsParser.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                    </span>2.33<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.68<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-70.6%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>87.1<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>34.4<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-60.5%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">lib/AST/StmtViz.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                                  </span>1.28<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.48<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-62.5%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>62.4<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>39.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-37.5%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">tools/driver/cc1_main.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                            </span>3.05<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>1.29<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-57.8%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>93.7<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>58.6<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-37.4%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">unittests/CodeGen/<wbr class="">BufferSourceTest.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                 </span>4.12<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>2.62<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-36.5%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>145.8<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>103.9<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>-28.7%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">lib/CodeGen/CGLoopInfo.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                           </span>2.43<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>1.68<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-30.7%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>101.6<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>82.5<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-18.8%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">unittests/CodeGen/<wbr class="">CodeGenExternalTest.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">              </span>4.50<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>3.21<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-28.6%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>155.5<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>125.1<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>-19.5%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">lib/Driver/ToolChains/Contiki.<wbr class="">cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                      </span>0.53<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>0.38<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-28.1%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>42.4<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>38.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-10.5%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">unittests/Tooling/<wbr class="">RefactoringActionRulesTest.cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">       </span>3.22<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>2.34<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-27.5%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>108.3<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">  </span>90.0<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-16.9%</font></span></div><div class=""><span class="" style="font-size: 11px;"><font face="Menlo" class="">lib/Serialization/GeneratePCH.<wbr class="">cpp<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">                      </span>2.38<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>1.78<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-25.1%<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;"> </span>83.8<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>71.1<span class="m_-5777518192889444194Apple-tab-span" style="white-space: pre-wrap;">   </span>-15.1%</font></span></div></div><div class=""><br class=""></div><div class="">Full list:</div><div class=""></div></div></div><span id="m_-5777518192889444194cid:3779124B-B6AC-4246-B303-A9C10637540B@wp.comcast.net" class=""><clang.txt></span><div class="" style="word-wrap: break-word;"><div class=""><div class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The updated patches:</div><div class=""></div></div></div><span id="m_-5777518192889444194cid:CA6621F4-DA98-4F50-85F1-D36AA08C384E@wp.comcast.net" class=""><llvm_redundant_headers.patch></span><div class="" style="word-wrap: break-word;"><div class=""><div class=""></div></div></div><span id="m_-5777518192889444194cid:1EB43E2E-1C9F-41C4-8766-759D37E3AA8A@wp.comcast.net" class=""><clang_redundant_headers.<wbr class="">patch></span><div class="" style="word-wrap: break-word;"><div class=""><div class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Michael</div><div class=""><div class="h5"><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 8, 2017, at 9:20 AM, Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-5777518192889444194Apple-interchange-newline"><div class=""><div class="" 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_-5777518192889444194Apple-interchange-newline"><br class=""><blockquote type="cite" class=""><div class="">On Dec 6, 2017, at 1:17 PM, Matthias Braun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-5777518192889444194Apple-interchange-newline"><div class=""><div class="" 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 class="" 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 class="" 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 class="" 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 class="" 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 class="" 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 class="" 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 class=""></div><div class="" 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/<wbr class="">understandability we loose when relying on transitive includes weights heavier than my desire to get a faster build…</div></div></blockquote><div class=""><br class=""></div><div class="">+1</div><div class=""><br class=""></div><div class="">Q.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="" 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 class=""></div><div class="" 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 class="" 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 class=""><blockquote type="cite" class=""><div class="">On Dec 6, 2017, at 12:28 PM, serge guelton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-5777518192889444194Apple-interchange-newline"><div class=""><span class="" 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 class="" 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" class="" 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=""><blockquote type="cite" class="">On Dec 6, 2017, at 9:00 AM, mats petersson via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">In my experience, a lot of time is spent on optimizing the code (assuming it's not a "-O0" build).<br class=""></blockquote>The numbers were actually for the debug build (-O0 -g), so for Release build they would be different (presumably lower).<br class=""><blockquote type="cite" class="">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 class=""></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 class=""><blockquote type="cite" class=""><br class="">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 class=""></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 class=""></blockquote><br class="" 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 class="" 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 class="" 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="" 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 class="" 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 class="" 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 class="" 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 class="" 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="" 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 class="" 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 class="">_________________</span><br class="" 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 class="" 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 class="" 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" target="_blank" class="" 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;">llvm-dev@lists.llvm.org</a><br class="" 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" target="_blank" class="" 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;">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a></div></blockquote></div><br class="" 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 class="" 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 class="">_________________</span><br class="" 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 class="" 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 class="" 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" target="_blank" class="" 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;">llvm-dev@lists.llvm.org</a><br class="" 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" target="_blank" class="" 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;">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a></div></blockquote></div><br class="" 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 class="" 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 class="">_________________</span><br class="" 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 class="" 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 class="" 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" target="_blank" class="" 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;">llvm-dev@lists.llvm.org</a><br class="" 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" target="_blank" class="" 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;">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a></div></blockquote></div><br class=""></div></div></div></div></div><div class=""><div class="h5">______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class=""></div></div></div></blockquote></div><br class=""></div><br class="">______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a></blockquote></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>