chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] -O3 and -unboxing


From: Mario Domenech Goulart
Subject: Re: [Chicken-hackers] -O3 and -unboxing
Date: Tue, 05 Jul 2011 08:51:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Hi Felix,

On Tue, 05 Jul 2011 13:12:25 +0200 (CEST) Felix <address@hidden> wrote:

> From: Mario Domenech Goulart <address@hidden>
> Subject: [Chicken-hackers] -O3 and -unboxing
> Date: Mon, 04 Jul 2011 18:05:26 -0400
>
>> The docs (http://wiki.call-cc.org/man/4/Using%20the%20compiler) state
>> that:
>> 
>>  -optimize-level 3 is equivalent to 
>>  -optimize-leaf-routines -local -inline -inline-global -unboxing
>> 
>> And that
>> 
>> -unboxing
>>     try to use unboxed temporaries for numerical operations. This
>>     optimization is only effective in unsafe mode.
>> 
>> 
>> Since -O3 doesn't use -unsafe and -unboxing is only effective in unsafe
>> mode, is there any reason for adding -unboxing to level 3?
>
> It is there to enable unboxing if the user compiles in unsafe mode. Since
> this may be declared with "(declare (not safe))", I found it convenient to
> enable it anyway at this optimization level.

I see.  But if users compile their code with `-O3 -unsafe' (or -O3 and
`(declare (not safe))' in code), wouldn't it be exactly the same as -O4,
since:

-O3: -optimize-leaf-routines -local -inline -inline-global -unboxing
-O4: -optimize-leaf-routines -local -inline -inline-global -unboxing -unsafe

?

It's not a big deal in the end, but my point is that if -unboxing is
only effective when compiling in unsafe mode, and the only difference
between -O3 and -O4 is exactly -unsafe, there's not much point in having
-unboxing in -O3 when it would only be effective when you use -unsafe --
then that'd be the same as -O4.  Unless I'm missing something, of
course.

As you can realize by now, this message is just about nitpicking to
annoy you.


Best wishes.
Mario
-- 
http://parenteses.org/mario



reply via email to

[Prev in Thread] Current Thread [Next in Thread]