back

PROMISE Options Reference

Some options could be passed to PROMISE to control the transformations of the program being compiled using lcc option -Wm. There is also additional lcc option -M preventing call to PROMISE so actually lcc -M means 'lcc without PROMISE'.

PROMISE options are divided into the three sets: general options, options controlling intraprocedural optimizations and interprocedural options.

General options are:

  • -l - prints list of function names in current module
  • -v - prints optimization profile for current module (see below)
  • -g def;def;... - defines group of functions. Each def has the form group_id=func_id,func_id,... where group_id is group identifier, func_ids are identifiers of functions in current module
  • Intraprocedural options are:

  • -p spec;spec;... - specify optimization profile. Optimization profile allows to define separate set of transformations for each function (or group of functions). Option -v could be used to check whether PROMISE has understood you correctly. spec has the form group_id=pass,pass,..., where group_id is group identifier (see option -g definition above) or function identifier, pass - optimization pass identifier. Note that there is special group * denoting all the functions in the current module that do not belong to either group. Optimization pass identifier is one of the following:
  • ssa - perform transformation to SSA
  • cp - perform constant propagation
  • dce - perform dead code elimination (actually eliminates dead assignments)
  • cse - perform common subexpressions elimination
  • line - perform jump optimization
  • dump - dump intermediate program representation


  • Additionally unreachable code is eliminated before the start of any optimization. Note that phi-nodes elimination is forced only during conversion back to pickle, so it is possible to perform all of the optimizations over the SSA.
  • Interprocedural options are:

  • -ip pass,pass,... - specify interprocedural passes. This option forces transformations over all the functions in the current module and does not affect optimization profile. Interprocedural passes are:
  • inline - perform inlining
  • icp - perform interprocedural constant propagation
  • idce - perform interprocedural dead code elimination (actually eliminates dead assignments)


  • Note that you must have main function in the module being interprocedurally optimized since it is required for call graph construction.
  • Examples:

    lcc -Wm"-l" foo.c -c -o foo.o - print names of all functions declared in foo.c

    lcc -Wm"-g noopt=main -p *=ssa,cp,cse,dce" foo.c -c -o foo.o- perform ssa, cp, cse and dce optimizations over the all functions in foo.c except main.


    back

    Copyright © OOPS Team
    webmaster@oops.math.spbu.ru