Csound Csound-dev Csound-tekno Search About

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

Date2018-08-29 12:55
FromMauro Giubileo
Subject[Csnd-dev] Is adding zero to an a-type variable optimized?

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


Date2018-08-29 13:13
FromJohn ff
SubjectRe: [Csnd-dev] Is adding zero to an a-type variable optimized?
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 <mgiubileo@computeraltafed.it> 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


Date2018-08-29 13:46
FromMauro Giubileo
SubjectRe: [Csnd-dev] Is adding zero to an a-type variable optimized?

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 <mgiubileo@computeraltafed.it> 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