HomePhabricator

[LoopUnroll] add parsing for unroll parameters in -passes pipeline

Description

[LoopUnroll] add parsing for unroll parameters in -passes pipeline

Allow to specify loop-unrolling with optional parameters explicitly
spelled out in -passes pipeline specification.
Introducing somewhat generic way of specifying parameters parsing via
FUNCTION_PASS_PARAMETRIZED pass registration.

Syntax of parametrized unroll pass name is as follows:

'unroll<' parameter-list '>'

Where parameter-list is ';'-separate list of parameter names and optlevel

optlevel: 'O[0-3]'
parameter: { 'partial' | 'peeling' | 'runtime' | 'upperbound' }
negated:  'no-' parameter

Example:

-passes=loop(unroll<O3;runtime;no-upperbound>)

 this invokes LoopUnrollPass configured with OptLevel=3,
 Runtime, no UpperBound, everything else by default.