<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 7, 2016 at 2:20 PM Xinliang David Li <<a href="mailto:davidxl@google.com">davidxl@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Oct 7, 2016 at 1:35 PM, David Blaikie <span dir="ltr" class="gmail_msg"><<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><span class="gmail_msg"><div dir="ltr" class="gmail_msg">On Fri, Oct 7, 2016 at 1:27 PM Dehao Chen <<a href="mailto:dehao@google.com" class="gmail_msg" target="_blank">dehao@google.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">In theory, compiler should generate bit-identical code with and without debug info. I.e.<div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"># clang -c -O2 -g a.cc -o a.g.o</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"># clang -c -O2 -g0 a.cc -o a.g0.o</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"># strip a.g.o a.g0.o</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"># diff a.g.o a.g0.o </div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">The diff should find two binaries identical. For brevity, in the rest of the mail, I'll refer to this requirement as "codegen consistency" (any better name?)</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><br class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"></div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">Unfortunately, LLVM does not guarantee codegen consistency. Recently, I've spent quite some time try to fix related issues (e.g. <a href="https://reviews.llvm.org/D25286" class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg" target="_blank">https://reviews.llvm.org/D25286</a> and <a href="https://reviews.llvm.org/D25098" class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg" target="_blank">https://reviews.llvm.org/D25098</a>). The most recent issue I'm looking at is that during isel, the IROrder is used by both debug info and the actual codegen, which is relative harder to fix.<div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><br class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"></div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">I initially thought that it's just a couple of careless bugs to fix. But looks like there are much more issues than I expected. So I'm calling the community for help:</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><br class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"></div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">* Is there anyone else who also cares about codegen consistency?</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">* Any volunteers to help fix codegen consistency issues? (It is easy to find issues, just build speccpu with -g and -g0, then compare the "objdump -d" output)</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">* How to setup a regression test to ensure future changes does not break codegen consistency?</div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></span><div class="gmail_msg">Specific test cases would be checked in as usual - beyond that, probably a self-host that checks for consistency (like a 3 stage bootstrap checks that stage 2 and 3 are identical). Potentially other workloads could be added if a selfhost didn't offer enough certainty for common cases.<br class="gmail_msg"><br class="gmail_msg">It's an abstract good/intended goal, for sure - but it's not been a priority for anyone (as you've seen), so just hasn't been pushed very hard/far.<br class="gmail_msg"></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">I agree with you that this is a good/intended goal, but it is not 'abstract' good goal :)</div></div></div></div></blockquote><div><br></div><div>Abstract in the sense that no one's had concrete needs for/problems with it so far - or insufficiently so that it wasn't worth working on.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">David</div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg">- Dave</div><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><br class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"></div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">Any comments?</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"><br class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg"></div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">Thanks,</div><div class="m_7421935964003943042m_2836692863301252102gmail_msg gmail_msg">Dehao</div></div>
</blockquote></div></div>
</blockquote></div></div></div></blockquote></div></div>