On Tue, Jan 14, 2014 at 11:30 PM, Justin Bogner <[email protected]>wrote:

> Author: bogner
> Date: Wed Jan 15 01:30:30 2014
> New Revision: 199302
>
> URL: http://llvm.org/viewvc/llvm-project?rev=199302&view=rev
> Log:
> CodeGen: Simplify CodeGenFunction::EmitCaseStmt
>
> Way back in r129652 we tried to avoid emitting an empty block at -O0
> for switch cases that did nothing but break. This led to a poor
> debugging experience as reported in PR9796, so we disabled the
> optimization for -O0 but left it in for higher optimization levels in
> r154420.
>
> Since the whole point of this was to improve -O0, it's silly to keep
> the complexity at all.
>

Hold on, I don't think that's the right way to interpret this.

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.

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.

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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to