[Csnd-dev] Is adding zero to an a-type variable optimized?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] Is adding zero to an a-type variable optimized?

Mauro Giubileo

Hi, sorry if it could be a trivial question but I wonder if the following situation is optimized in the current Csound implementation:

aZero = 0
aSig = aSig + aZero

In the second statement of the above situation, Csound engine adds '0' to each element of aSig, or it recognize that it's useless to do that and so, just returns aSig?

Best Regards,
Mauro

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Is adding zero to an a-type variable optimized?

jpff
It recognises as+0 but does not do constant propogation.  At least since yesterday.

At present no datsflow optimisations

Sent from TypeApp
On 29 Aug 2018, at 12:56, Mauro Giubileo <[hidden email]> wrote:

Hi, sorry if it could be a trivial question but I wonder if the following situation is optimized in the current Csound implementation:

aZero = 0
aSig = aSig + aZero

In the second statement of the above situation, Csound engine adds '0' to each element of aSig, or it recognize that it's useless to do that and so, just returns aSig?

Best Regards,
Mauro

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Is adding zero to an a-type variable optimized?

Mauro Giubileo

Ok... Should I fill an issue on github for this optimization or it is already in the works?


Il 2018-08-29 14:13 John ff ha scritto:

It recognises as+0 but does not do constant propogation.  At least since yesterday.

At present no datsflow optimisations

Sent from TypeApp
On 29 Aug 2018, at 12:56, Mauro Giubileo <[hidden email]> wrote:

Hi, sorry if it could be a trivial question but I wonder if the following situation is optimized in the current Csound implementation:

aZero = 0
aSig = aSig + aZero

In the second statement of the above situation, Csound engine adds '0' to each element of aSig, or it recognize that it's useless to do that and so, just returns aSig?

Best Regards,
Mauro