[LLVMdev] RFC: Codifying (but not formalizing) the optimization levels in LLVM and Clang
Chandler Carruth
chandlerc at google.com
Mon Jan 14 14:43:30 PST 2013
On Mon, Jan 14, 2013 at 8:00 AM, Krzysztof Parzyszek <
kparzysz at codeaurora.org> wrote:
> On 1/14/2013 3:09 AM, Chandler Carruth wrote:
>
>>
>> [...] This level should always produce
>>
>> binaries at least as fast as quickopt, but they might be both slower to
>> compile.
>>
>
> The "always" part cannot really be guaranteed or enforced. I'd state it
> in terms of intention, i.e. "this level is intended to produce binaries at
> least as fast as quickopt". Otherwise, the wording may imply that it is a
> compiler bug if there exists a binary that runs slower at -O2 than at -O1.
The use of 'should' is not accidental in my proposal. I don't read 'should'
as implying any more or less of a guarantee (much less an enforcement) than
yours.
But clearly we cannot make guarantees or enforce things. That's not really
the point. What matters is that when at some point someone shows up with
data that shows "here is a way in which -O2 is faster than -O3", that does
get classified as a bug, not a feature. =] That doesn't mean there will be
an easy or obvious solution, but it does give us the right perspective on
finding a solution.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130114/099a9d36/attachment.html>
More information about the llvm-dev
mailing list