On 15 January 2014 02:16, Dicebot <public@dicebot.lv> wrote:
On Tuesday, 14 January 2014 at 15:37:21 UTC, Manu wrote:
Sorry, that was 2 separate points although it didn't look like it.
The first question was assuming full optimisation, is it equivalent to the
if statement I demonstrate with full optimisation in practise? (I'll do
some tests, but people must have already experimented in various
circumstances, and identified patterns?)

Don't think so. LDC is best at doing such transformation per my observations but it still major are for improvements in general.

So you're saying that using these primitives like until! and filter! will not produce the same code as my if statement when optimised?
That's worrying. I'll have to try it out.

I'd like to know if anybody can see any path towards inlined
lambda's/literal's/micro-functions in non-optimised builds?
I guess the first question is, is this a problem that is even worth
addressing? How many people are likely to object in principle?

I'd object against it general. Important trait of such builds is resulting code gen that matches original source code as much as possible. Mass inlining will kill it. But I don't see why you use "debug" and "non-optimised" as synonyms here. For example, in DMD "-release" vs "-debug" are orthogonal to "-O". I see no problems with doing optimised debug build.

You can't step a -O build, or inspect the value of most variables. So you can't really debug.