Peephole optimization for consecutive lines of code with SET commands
Final Release Note
Description
Octo generates blocks of SET commands that look like this:
. . . SET %ydboctoexpr=%ydboctocursor(cursorId,"keys",1,"USPRESIDENTS","FIRSTYEAR")
. . . SET %ydboctoexpr=$$str2mval^%ydboctoplanhelpers(%ydboctoexpr)
. . . SET %ydboctoexpr(0)=%ydboctoexpr
. . . SET %ydboctoexpr=%ydboctocursor(cursorId,"keys",1,"USPRESIDENTS","LASTYEAR")
. . . SET %ydboctoexpr=$$str2mval^%ydboctoplanhelpers(%ydboctoexpr)
. . . SET %ydboctoexpr=%ydboctoexpr(0)_%ydboctoexpr
…
When compiled with the -noline_entry
option from the command line or $ZCOMPILE, it will improve performance and reduce size with peephole optimization that treats the above as a single line, e.g.:
. . . SET %ydboctoexpr=%ydboctocursor(cursorId,"keys",1,"USPRESIDENTS","FIRSTYEAR"),%ydboctoexpr=$$str2mval^%ydboctoplanhelpers(%ydboctoexpr),%ydboctoexpr(0)=%ydboctoexpr,%ydboctoexpr=%ydboctocursor(cursorId,"keys",1,"USPRESIDENTS","LASTYEAR"),%ydboctoexpr=$$str2mval^%ydboctoplanhelpers(%ydboctoexpr),%ydboctoexpr=%ydboctoexpr(0)_%ydboctoexpr
…
Draft Release Note
NO RELEASE NOTE NEEDED as this is a performance optimization. [#773]
Edited by K.S. Bhaskar