Re: Short-circuiting the optimizer
- From: nmm1@xxxxxxxxxxxxx (Nick Maclaren)
- Date: 20 Jun 2006 11:51:02 GMT
In article <ao2lm3-c7m.ln1@xxxxxxxxxxxxxxxxxxxxxxx>,
Terje Mathisen <terje.mathisen@xxxxxxxxxxxxx> writes:
|> glen herrmannsfeldt wrote:
|> > Nick Maclaren wrote:
|> >
|> > (snip on fooling optimizers)
|> >
|> >> See my remark about global optimisation. What you are saying is that you
|> >> can produce code too complicated for the compiler to analyse. True. You
|> >> can - for any finite, fixed set of compilers. But, for every contortion
|> >> you go through, I could write a compiler that could recognise it.
|> >
|> >> This is the same problem as military intelligence, (deterministic) game
|> >> theory, security analysis and so on. If one side puts more or higher
|> >> quality resources into it than the other, it will usually win.
|> >
|> > Say one calls an external function that hasn't been written yet.
|> > Without a crystal ball, the compiler is going to have a hard
|> > time inlining that function. For systems that support linking
|> > of separately compiled functions, this should always work.
Nope :-) As Terje points out, that is true only if you have a guaranteed
dumb linker. Several current systems call fancy optimisers from their
linkers.
|> It does, as long as that external function is (or will be) written in a
|> language that cannot be analyzed by the compiler/linker, i.e. a
|> separately compiled function consisting of inline asm code is sufficient
|> for all compilers I've ever seen or expect to see.
I have a one word counter-example: ANDF.
Regards,
Nick Maclaren.
.
- Follow-Ups:
- Re: Short-circuiting the optimizer
- From: Terje Mathisen
- Re: Short-circuiting the optimizer
- References:
- Testing for IEEE infinity and NaN?
- From: Raymond Toy
- Re: Testing for IEEE infinity and NaN?
- From: bert
- Re: Testing for IEEE infinity and NaN?
- From: Raymond Toy
- Short-circuiting the optimizer
- From: Steve Richfie1d
- Re: Short-circuiting the optimizer
- From: Terje Mathisen
- Re: Short-circuiting the optimizer
- From: toby
- Re: Short-circuiting the optimizer
- From: Steve Richfie1d
- Re: Short-circuiting the optimizer
- From: Nick Maclaren
- Re: Short-circuiting the optimizer
- From: glen herrmannsfeldt
- Re: Short-circuiting the optimizer
- From: Terje Mathisen
- Testing for IEEE infinity and NaN?
- Prev by Date: Re: Short-circuiting the optimizer
- Next by Date: Re: Short-circuiting the optimizer
- Previous by thread: Re: Short-circuiting the optimizer
- Next by thread: Re: Short-circuiting the optimizer
- Index(es):
Relevant Pages
|
|