<div dir="ltr"><div dir="ltr">On Mon, Sep 16, 2019 at 11:03 AM Roman Lebedev via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><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">Hello.<br>
<br>
This was brought up several times now, but looks like it needs to be<br>
mentioned more globally. Clang has many (~1516) front-end codegen tests.<br>
Out of those tests, 364 tests are likely "broken":<br>
$ clang/test$ grep -rl " -O[1-3]" | wc -l<br>
364<br></blockquote><div><br></div><div>It's an issue, but it's not as bad as that. Many tests use `-O1 -disable-llvm-passes` to get "optimized" IR output from clang which is slightly different. This matters for lifetime markers, for example.</div><div><br></div><div>I tried this query and got these results:</div><div>$ git grep -l " -O[1-3]" ../clang/test | xargs grep -L -l ' -disable' | wc -l<br>99<br></div><div><br></div><div>So, 99/~1516 -> ~6.5% tests use the bad pattern. Some of the tests are truly integration tests, checking that clang emits an IR pattern that LLVM can optimize, but I think most are not.</div><div><br></div><div>I think the real issue here is that writing CHECK lines for clang's IR output is a pain, so people lean on the optimizer to clean up the IR first so they can match something that's more logical. If we did something to improve that, the situation wouldn't be as bad.</div></div></div>