Re: [PATCH] fix expansion cost of pure functions

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

 



On Thu, Feb 16, 2017 at 11:45 PM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> Expansion cost of an expression should be a monotonically
> increasing function of its sub-expressions.
>
> Here, for the costs of calling a pure function, the costs is
> reset to zero (wich is used when the expression expand to
> a constant/to test if the expression is a constant or not).
>
> Fix this by setting the cost as the total expansion cost of
> all the arguments plus one for the function itself.

I am not sure about this one, adding CC to Linus.

Currently pure function and constant function both share MOD_PURE.
If the function has attribute "pure" or "constant", then the user is
telling the compiler this function does not have side effects.

I think dropping to zero has some thing to do with get rid of
the side effect cost. So it possible the cost can be dropping.
But maybe it shouldn't drop to zero.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux