<div dir="ltr">Completely agree. Any code generation changes due to debug info are a bug and should be handled accordingly :)<div><br></div><div>-eric<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 7, 2016 at 3:28 PM Xinliang David Li via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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">A good start is to start file upstream bugs found in SPEC and clang self build. Once those bugs are fixed, we need to set up bots to do 3-stage bootstrap of clang to ensure no regressions are introduced.</div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">David</div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Oct 7, 2016 at 3:25 PM, Adrian Prantl <span dir="ltr" class="gmail_msg"><<a href="mailto:aprantl@apple.com" class="gmail_msg" target="_blank">aprantl@apple.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"><span class="gmail_msg"><br class="gmail_msg">
> On Oct 7, 2016, at 1:27 PM, Dehao Chen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> In theory, compiler should generate bit-identical code with and without debug info. I.e.<br class="gmail_msg">
> # clang -c -O2 -g a.cc -o a.g.o<br class="gmail_msg">
> # clang -c -O2 -g0 a.cc -o a.g0.o<br class="gmail_msg">
> # strip a.g.o a.g0.o<br class="gmail_msg">
> # diff a.g.o a.g0.o<br class="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?)<br class="gmail_msg">
><br class="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" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D25286</a> and <a href="https://reviews.llvm.org/D25098" rel="noreferrer" class="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.<br class="gmail_msg">
><br class="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:<br class="gmail_msg">
><br class="gmail_msg">
> * Is there anyone else who also cares about codegen consistency?<br class="gmail_msg">
<br class="gmail_msg">
</span>We have in the past always treated situations where the presence of debug info caused different code to be emitted as pretty serious bugs. Typically these bugs came from code that didn't properly skip over debug intrinsics when doing peephole-style transformations.<br class="gmail_msg">
<span class="gmail_msg"><br class="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)<br class="gmail_msg">
<br class="gmail_msg">
</span>I certainly don't mind getting CC'ed on any PRs that we find :-)<br class="gmail_msg">
<br class="gmail_msg">
-- adrian<br class="gmail_msg">
<span class="gmail_msg"><br class="gmail_msg">
> * How to setup a regression test to ensure future changes does not break codegen consistency?<br class="gmail_msg">
><br class="gmail_msg">
> Any comments?<br class="gmail_msg">
><br class="gmail_msg">
> Thanks,<br class="gmail_msg">
> Dehao<br class="gmail_msg">
</span>> _______________________________________________<br class="gmail_msg">
> LLVM Developers mailing list<br class="gmail_msg">
> <a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div></div>