<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 11:30 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":73m" style="overflow:hidden">Author: bogner<br>
Date: Wed Jan 15 01:30:30 2014<br>
New Revision: 199302<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=199302&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=199302&view=rev</a><br>
Log:<br>
CodeGen: Simplify CodeGenFunction::EmitCaseStmt<br>
<br>
Way back in r129652 we tried to avoid emitting an empty block at -O0<br>
for switch cases that did nothing but break. This led to a poor<br>
debugging experience as reported in PR9796, so we disabled the<br>
optimization for -O0 but left it in for higher optimization levels in<br>
r154420.<br>
<br>
Since the whole point of this was to improve -O0, it's silly to keep<br>
the complexity at all.</div></blockquote></div><br>Hold on, I don't think that's the right way to interpret this.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Allocating, wiring up, optimizing and deleting the block all have very non-trivial compile-time cost. They introduce guaranteed malloc traffic. Worse, linear amounts of malloc traffic.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">It seems very worth a small amount of complexity in clang to emit more minimal IR. While I'm OK keeping these blocks when we need them (for whatever reason, debugging, profiling, whatever), I don't think we should unilaterally keep them.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I can move the discussion to the code review thread if you'd like, but this commit seemed to take things a significant step further than was discussed in that thread by *always* keeping these blocks.</div>
</div>