moo - analyze SUIF program for privatizable scalar variables.
moo -Psce infile outfile
The moo program reads in a SUIF file one procedure at a time, attaching to each for-loop an annotation that indicates the privatizable scalar variables of the loop. A variable is privatizable if every iteration of the for-loop can have its own copy of the variable. The annotated SUIF program is written out into outfile.
Moo considers a scalar variable as privatizable if the variable is read or written in the loop and there are no upward exposed read of the variable at the entry of the loop body, and if no definition of the variable in the loop reaches a use outside of the loop. For example, in the following program fragment:
do 100 i=1,10
p = f(np)
100 np = g(p)
the variable p is privatizable while the variable np is not. In the SUIF excerpt from moo's output of the above fragment, there are three kinds of annotations: one indicates that i, np, and p are read in the loop, one indicates that i, np, and p are written, and one that indicates i, and p are privatizable.
2: FOR (Index=MAIN__.i Test=SLTE Cont=L:MAIN__.L1 Brk=L:MAIN__.L2) ["read vars": <MAIN__.i,0> <MAIN__.np,0> <MAIN__.p,0>] ["write vars": <MAIN__.i,0> <MAIN__.np,0> <MAIN__.p,0>] ["privatizable": <MAIN__.i,0> <MAIN__.p,0>]
Moo accepts exactly one flag -Psce. Every time you invoke moo, you must include this flag. Moo has been designed to serve as the basis for a new scalar optimizer to replace oynk. If and when that happens, moo will accept other flags.