<div dir="ltr"><div dir="ltr"><div>Relabeling the thread, because we abandoned the abseil dependency in google/benchmark upstream, but we still have the topic of 3 copies of roughly the same thing in LLVM.</div><div><br></div><div>So the summary is: today we have:</div><div><div><br></div><div>llvm-test-suite/MicroBenchmarks/libs/benchmark/</div><div>llvm-project/llvm/utils/benchmark<br></div>llvm-project/libcxx/utils/google-benchmark<br></div><div><br></div><div>Each copy is maintained as needed, and cherrypicks are quite similar across the copies.</div><div><br></div><div>If we want to get to one copy, Chris' proposal was to consolidate on 'llvm-project/llvm/utils/benchmark'; and presumably we don't have any reason to change the way we maintain the copy.</div><div><br></div><div>I'd like to do this consolidation. Is there any pushback to the plan above? </div><div><br></div><div>One thing that does come to mind, llvm-test-suite can be cloned separately from llvm-project/llvm. We'd need to point to llvm (or just llvm/utils/benchmark), and require that it be available on bots, for example. Does that cause an issue for anyone? </div><div><br></div></div>Thanks,<div>Mircea</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 10, 2021 at 9:08 PM Chris Lattner <<a href="mailto:clattner@nondot.org">clattner@nondot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">On Oct 9, 2021, at 7:32 PM, Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 9, 2021 at 6:15 PM Chris Lattner <<a href="mailto:clattner@nondot.org" target="_blank">clattner@nondot.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><blockquote type="cite"><div>On Sep 30, 2021, at 10:07 AM, Mircea Trofin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">TL;DR; When either of LLVM_BUILD_BENCHMARKS or LIBCXX_INCLUDE_BENCHMARKS are enabled, as well as for llvm-test-suite, a dependency to abseil would either be auto-downloaded by the build system, or need to be user-specifiable, or provided in the source tree.</div></div></blockquote><div><br></div><div><div>Hi Mircea,</div><div><br></div><div>As others have pointed out, this seems like a fairly problematic dependency to take on.</div><div><br></div></div></div></div></blockquote><div>(For clarity, not attempting to argue pros/cons re abseil) it would be, if we wanted to start pulling more frequently and automatically from google/benchmark upstream. So far we've been cherry-picking changes, from what I can tell.</div></div></div></div></blockquote><div><br></div><div>Ok, but why?  LLVM’s need for this should be fairly simple.  I don’t follow what mainline google/benchmark is trying to achieve, but do we need it?</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div><div></div></div><blockquote type="cite"><div><div dir="ltr"><div><div>There are (afaik) 3 copies of the <a href="https://github.com/google/benchmark" target="_blank">google/benchmark</a> project in the llvm tree: in llvm-test-suite, in llvm/utils, and in libcxx/utils/.</div></div></div></div></blockquote><div><br></div><div>Ok, that sounds bad.  It seems like an intermediately good step is to have a single copy of this in the monorepo (e.g.) in llvm-project/utils, and have livcxx and llvm-test-suite use that copy.  Is there any downside to consolidating these?</div></div></div></blockquote><div><br></div><div>Would we also want to start more frequently sync-ing with the google/benchmark upstream - do we have a reason not to? (assuming there's no abseil dep to worry about). </div></div></div></div></blockquote><div><br></div><div>I don’t understand the tradeoffs here - what do we get, vs what pain does it cause?  I don’t think that sync’ing with it is by itself a good thing, it should be motivated by cost/benefit analysis.</div><div><br></div><div>I’m not up to speed on the goals of google/benchmark, but I suspect that google in general has different concerns than LLVM does.  It may be better to just straight-out fork or reimplement it from scratch.</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><blockquote type="cite"><div><div dir="ltr"><div><div>The benchmark code uses some functionality otherwise offered by <a href="https://abseil.io/" target="_blank">abseil</a>. Over time, this is inconvenient: continued need for duplication for some features; integration issues in projects using abseil due to macro conflicts; and overall bit rot / maintenance overhead.</div></div></div></div></blockquote><div><br></div><div>I’m not sure what you mean here - I think you are saying that there is code from abseil that was copied into the google benchmark library, and downstream code that uses both has issues?  Or are you saying it is similar-but-different functionality that happens to use the same macro names?</div></div></div></blockquote><div><br></div><div>It's mainly the former. IIRC, we also hit an issue with the latter, e.g. flag macros that are implemented slightly differently, but the root cause is  the former. <b>dominichamon@</b> may have more details, and there was another participant, <b>oontvoo@</b>, who <a href="https://github.com/google/benchmark/pull/1183#issuecomment-889221305" target="_blank">expressed interest</a> in the abseil dependency, but haven't dug deeper into their motivation. </div></div></div></blockquote><div><br></div>Ok, it would be good to understand that better, because otherwise adding a dependency is strictly a negative IMO.</div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>Because I don’t understand the benefit, it seems like introducing a new dependency is just a negative - can you explain the benefit more?</div></div></div></blockquote><div><br></div><div>It would solve those downstream issues, but (and we'd have to check with e.g. oontvoo@ if it addressed their scenario) we can definitely think of an alternative that addressed the concerns expressed here, and solved the original problem we had. (We basically jumped to abseil first because it seemed like the obvious thing, not realizing the fullness of the implications, and gathering the feedback here and also on the thread in google/benchmark makes me, at least, strongly believe we need to think of an alternative)</div><div><br></div><div>I think at this point there are 2 topics: one is about how we consume google/benchmark in llvm; the other is the arguments against the abseil dep, which, even if for some reason llvm decided to freeze its copy of google/benchmark and thus not be affected, I think are sufficiently concerning to get us (switching hats to google/benchmark) rethink our approach.</div><div><br></div><div>Should we focus this thread then on the former?</div></div></div></blockquote><br></div><div>That sounds like a great approach to me, figuring out the first part seems like a good prerequisite to the second part in any case.  Thank you for driving this discussion in an open and inclusive way!</div><div><br></div><div>-Chris</div><br></div></blockquote></div></div></div>