<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 7, 2016 at 1:35 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</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><br><div class="gmail_quote"><span class=""><div dir="ltr">On Fri, Oct 7, 2016 at 1:27 PM Dehao Chen <<a href="mailto:dehao@google.com" target="_blank">dehao@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="m_2836692863301252102gmail_msg">In theory, compiler should generate bit-identical code with and without debug info. I.e.<div class="m_2836692863301252102gmail_msg"># clang -c -O2 -g a.cc -o a.g.o</div><div class="m_2836692863301252102gmail_msg"># clang -c -O2 -g0 a.cc -o a.g0.o</div><div class="m_2836692863301252102gmail_msg"># strip a.g.o a.g0.o</div><div class="m_2836692863301252102gmail_msg"># diff a.g.o a.g0.o </div><div class="m_2836692863301252102gmail_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_2836692863301252102gmail_msg"><div class="m_2836692863301252102gmail_msg"><br class="m_2836692863301252102gmail_msg"></div><div class="m_2836692863301252102gmail_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_2836692863301252102gmail_msg" target="_blank">https://reviews.llvm.<wbr>org/D25286</a> and <a href="https://reviews.llvm.org/D25098" class="m_2836692863301252102gmail_msg" target="_blank">https://reviews.llvm.org/<wbr>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_2836692863301252102gmail_msg"><br class="m_2836692863301252102gmail_msg"></div><div class="m_2836692863301252102gmail_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_2836692863301252102gmail_msg"><br class="m_2836692863301252102gmail_msg"></div><div class="m_2836692863301252102gmail_msg">* Is there anyone else who also cares about codegen consistency?</div><div class="m_2836692863301252102gmail_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_2836692863301252102gmail_msg">* How to setup a regression test to ensure future changes does not break codegen consistency?</div></div></div></div></blockquote><div><br></div></span><div>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><br>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></div></div></div></blockquote><div><br></div><div>I agree with you that this is a good/intended goal, but it is not 'abstract' good goal :)</div><div><br></div><div>David</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_quote"><div><br>- Dave</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="m_2836692863301252102gmail_msg"><div class="m_2836692863301252102gmail_msg"><br class="m_2836692863301252102gmail_msg"></div><div class="m_2836692863301252102gmail_msg">Any comments?</div><div class="m_2836692863301252102gmail_msg"><br class="m_2836692863301252102gmail_msg"></div><div class="m_2836692863301252102gmail_msg">Thanks,</div><div class="m_2836692863301252102gmail_msg">Dehao</div></div>
</blockquote></div></div>
</blockquote></div><br></div></div>