<div dir="ltr">In theory, compiler should generate bit-identical code with and without debug info. I.e.<div># clang -c -O2 -g a.cc -o a.g.o</div><div># clang -c -O2 -g0 a.cc -o a.g0.o</div><div># strip a.g.o a.g0.o</div><div># diff a.g.o a.g0.o </div><div>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><div><br></div><div>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">https://reviews.llvm.org/D25286</a> and <a href="https://reviews.llvm.org/D25098">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><br></div><div>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><br></div><div>* Is there anyone else who also cares about codegen consistency?</div><div>* 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>* How to setup a regression test to ensure future changes does not break codegen consistency?</div></div></div><div><br></div><div>Any comments?</div><div><br></div><div>Thanks,</div><div>Dehao</div></div>