for (i=0; i<M; i=i+1) { for (j=1; j<N; j=j+1) { a[j+1]=a[j-1]+b[i]; } c[i]=a[N]; }execution will proceed as follos:
a[2]=a[0]+b[i]; a[3]=a[1]+b[i]; a[4]=a[2]+b[i]; a[5]=a[3]+b[i]; a[6]=a[4]+b[i]; ....If registers r0, r1, r2, r3 are available, then the above inner loop can be executed as follows:
r0=b[i]; r1=a[0]+r0; a[2]=r1; r2=a[1]+r0; a[3]=r2; r3=r1+r0; a[4]=r3; r1=r2+r0; a[5]=r1; r2=r3+r0; a[6]=r2; ....This transformation replaces memory accesses to elements of array a and array b to register accesses.
for(i=0; i<M;i=i+1) { j=0; v1=1; v3=2; for(; j<N-v1; j=j+v3) { a[j+1]=a[j-1]+b[i] a[j+2]=a[j]+b[i]; } for(; j<N; j=j+1) { a[j+1]=a[j-1]+b[i]; } c[i]=a[N]; }and then the scalar replacement by demand-driven PDE will be applied according to SSA options. An example of option specifications is
-coins:lir-opt=...can also be used instead of
-coins:ssa-opt=...(When ''lir-opt'' and ''ssa-opt'' are both written, only ''lir-opt'' is effective.)
Use SSA pass. This is necessary for using the SSA module. There are several optimizations in this module. To invoke the optimization, you should specify the optimizers with this option. Specified optimizers are invoked from left to right.
Both <optimizations-in-SSA-form> and <optimizations-in-normal-form> are optional with the separating "/".
note: <optimizations-in-normal-form> is available after coins-1.4.4.2.
<optimizations-in-SSA-form> is of the form "xxx/yyy/.../zzz". First, as `xxx' you MUST specify to which kind of SSA form you like to translate, such as minimal, semi-pruned or pruned. And then, as `yyy' you can specify the optimizers which the SSA module invokes. You can specify the same optimizer two times, three times, and so on. Only optimizations that you specify are performed in that order. Finally, as `zzz' you MUST specify how to back translate from SSA form.
These options are defined as follows:
note:
java -cp ./classes coins.ssa.ProApp -t xxxxwhere, ``-t'' option specifies xxx as the working directory. If ``-t'' option is not given, ``/tmp'' directory is used.
java -cp ./classes coins.ssa.ProApp -t xxxx -n
-coins:ssa-opt=stlin/shlin/prun/shlin/cse/shlin/srd3/shlinthen you may see the movement of instructions for some LIR instructions in the process of SSA optimization.
<optimizations-in-normal-form> is of the form "www/...". You can specify as `www' the following options.
Example (<optimizations-in-SSA-form>) : If you specify the option
-coins:ssa-opt=prun/cstp/cse/srd3the SSA module performs the following in that order:
Example (<optimizations-in-normal-form>/<optimizations-in-SSA-form>)
-coins:ssa-opt=divex2/esplt/pdeqp/prun/divex/cse/cstp/hli/osr/hli/cstp/cpyp/preqp/cstp/rpe/dce/srd3"divex2/esplt/pdeqp" is <optimizations-in-normal-form> and the rest is <optimizations-in-SSA-form>.
Following is an example that specifies the options ddpde and glia.
-coins:ssa-opt=divex2/esplt/pdeqp/ddpde/expde/prun/divex/cse/cstp/hli/osr/hli/cstp/cpyp/preqp/cstp/rpe/glia/dce/srd3
If you DO NOT want to do that, specify this option.
x1=phi(x1,x1,x1)
x1=phi(y1,y1,y1)
x1=phi(y1,y1,x1) or x1=phi(y1,y1,BOTTOM)
If you DO NOT want to do that, specify this option.
If you DO NOT want to do SSA based coalescing, specify this option.
If you WANT to do that, specify this option.
(This coalescing can be specified after any back translation method.
But it may have no effect after the back translation by Sreedhar's
Method III since that method does not insert copy assignment statements
which can be coalesced by Chaitin's coalescing.)
If you DO NOT want to do that, specify this option.
If you DO NOT want to do that, specify this option.
1 : Output only the message that the SSA module is invoked 100 : Output the agenda of the SSA module 1500 : Output two kinds of information: (a) The inserted phi-functions when the SSA module translates normal LIR into SSA form. (b) The inserted copy assign statements when the SSA module back translates SSA form into normal LIR. 2000 : Output general debug information of all optimizers in the SSA module 10000 : Output much information about Sreedhar's Method IIIThe trace information includes the levels less than or equal to what you specified. If you specify
trace=SSA.1500then the SSA module outputs information related to the level `1', `100' and `1500'.
-coins:ssa-opt=prun/dump/srd3/dumpthe SSA module outputs the LIR (1) after translation into the pruned SSA form, and (2) after back translation from SSA form.