🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mod.computers.pyramid
1 messages
1 total messages Started by boyle Thu, 12 Mar 1987 15:29
Re: problem with the interpretation of certain constants
#58
Author: boyle
Date: Thu, 12 Mar 1987 15:29
25 lines
1886 bytes
This is an interesting bug for me.  It appears to be a classic example
of scheduling the optimization (of removing multiplication by 1.0) too 
late in the derivation of the object program, after multiplications by 
1.0 have been converted to a form is which they are no longer easily
identifiable.  

This seems to be a general property of optimizations--"to everything 
there is a season".  They cannot be done too soon, because the
opportunity to apply them may not exist, and they should not be done
too late, because they may be much harder to detect than when done at
the best time, or (as in this case), other cases that shouldn't be
optimized may have been commoned with them.

I would suggest doing this optimization near the source code level.
Doing it at the object code level is likely to leave behind a lot to
clean up--nonoptimal register allocation, etc.  Consider the results
for the expression (a*1.0 - b*c), for example; after the
multiplication by 1.0 is removed, a register (unneed on some machine
architectures) might still be used to hold a.

I discuss this point briefly in a paper "Program Reusability through
Program Transformation" (hey, what can I say?) in the Sept. 84 IEEE
Transactions on Software Engineering.

		Jim Boyle
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads