How do I parallelize a Fortran code with SUIF 1?
You can use the provided parallelization driver:
pscc -parallel program.f
This driver executes a series of passes to parallelize a code.
- SF2C
: first pass of the SUIF Fortran 77 front end
- CPP
: preprocess
- SNOOT
: translate pre-processed C to SUIF
- FIXFORTRAN
: final processing for the SUIF Fortran 77 front end
- ENTRY_TYPES
: propagate parameter type info for Fortran entry points
- PORKY_PRE_DEFAULTS
PORKY_DEFAULTS : This does the default options to be used right after the front end, to turn some non-standard SUIF that the front end produces into standard SUIF. It also does some things, like constant folding and removing
empty symbol tables, to make the code as simple as possible without
losing information. It is equivalent to all of the options:
- fixbad
:
This fixes ``bad'' nodes. This is used as part of the default
expansion after the front end. Many analysis passes count on the
simplifying assumptions about control flow that they can make after
this pass.
- for-bound
:
This dismantles TREE_FORs unless the upper bound and step are both loop constants.
- no-index-mod
:
This dismantles TREE_FORs for which the index variable might be
modified by the TREE_FOR body.
- no-empty-fors
:
This dismantles TREE_FORs with empty bodies.
- no-empty-table
:
This dismantles all TREE_BLOCKs that have empty symbol tables.
- control-simp
:
This simplifies TREE_IFs for which this pass can tell that one branch
or the other always executes, leaving only the instructions from the
branch that executes and any parts of the test section that might have
side effects. It also removes entirely any TREE_FORs which it can
tell will never be executed.
- fold
:
This folds constants wherever possible.
- PORKY_LINE_FIX
:
This removes all mark instructions that contain nothing but line
information that is followed immediately by another line information
mark.
- LINKSUIF
: combine SUIF files into a file set.
- PORKY_UCF_OPT
:
Do simple optimizations on unstructured control flow (branches and
labels).
- PORKY_DEAD_CODE1
:
Simple dead-code elimination.
- STRUCTURE
: structure control flow.
- PORKY_FOLD1
:
This folds constants wherever possible.
- PORKY_FIND_FORS
:
This builds tree_for nodes out of tree_loop nodes for which a suitable
index variable and bounds can be found.
- PORKY_CONST1
:
Simple constant propagation.
- PORKY_FOLD2
:
- PORKY_COPY_PROP
:
This does copy propagation, which is the same as forward propagation
limited to expressions that are simple local variables (i.e. if there
is a simple copy from one local variable into another, uses of the
source variable will replace the destination variable where the copy
is live).
- PORKY_DEAD_CODE2
:
- PORKY_UNUSED1
:
This removes types and symbols that are never referenced and have no external
linkage, or that have external linkage but are not defined in this
file (i.e. no procedure body or var_def).
- PORKY_EMPTY_TABLE1
:
This dismantles all TREE_BLOCKs that have empty symbol tables.
- PORKY_EMPTY_FOR1
:
This dismantles TREE_FORs with empty bodies.
- PORKY_CONTROL_SIMP1
:
This simplifies TREE_IFs for which this pass can tell that one branch
or the other always executes, leaving only the instructions from the
branch that executes and any parts of the test section that might have
side effects.
- PORKY_FORWARD_PROP1
: move as much computation as possible into the bound expressions of each loop
- PORKY_FOLD3
:
- PORKY_DEAD_CODE3
:
- PORKY_LOOP_COND
: Move all loop-invariant conditionals that are inside a TREE_LOOP or
TREE_FOR outside the outermost loop.
- PORKY_FORWARD_PROP2
:
- PORKY_FOLD4
:
- PORKY_DEAD_CODE4
:
- PORKY_UNUSED2
:
- PORKY_EMPTY_TABLE2
:
- PORKY_EMPTY_FOR2
:
- PORKY_CONTROL_SIMP2
:
- PORKY_LOOP_INVARIANTS1
:This moves the calculation of loop-invariant expressions outside loop bodies.
- PORKY_FORWARD_PROP3
:
- PORKY_CSE1
: This does simple common sub-expression elimination.
- PORKY_CONST2
: This does simple constant propagation.
- PORKY_SCALARIZE
: This turns local array variables into collections of element variables
when all uses of the array are loads or stores of known elements. It
will partly scalarize multi-dimensional arrays if they can be
scalarized in some but not all dimensions.
- PORKY_FORWARD_PROP4
:
- PORKY_CONST3
:
- NORMALIZE
:
- PORKY_IVAR1
: This does simple induction variable detection.
- PORKY_IVAR2
:
- PORKY_IVAR3
:
- PORKY_KNOW_BOUNDS
: This replaces comparisons of upper and lower bounds of a loop inside the loop body with the known result of that comparison. This is particularly useful after multi-level induction variables have been replaced.
- PORKY_CONST4
:
- PORKY_FOLD5
:
- SCE0
:
- REDUCTIONS
:
- PORKY_EMPTY_FOR3
:
- PREDEP
:
- PORKY_DEAD_CODE5
:
- SKWEEL
:
- PORKY_UNCBR
: Replace call-by-reference scalar variables with copy-in, copy-out. This is useful when a later pass, such as a back-end compiler after
s2c will not have access to call-by-ref form.
- PGEN
:
- PORKY_FOLD6
:
- PORKY_FORWARD_PROP5
:
- PORKY_DEAD_CODE6
:
- PORKY_LOOP_INVARIANTS2
:
- PORKY_FORWARD_PROP6
:
- PORKY_CSE2
:
- PORKY_DEAD_CODE7
:
- CFORM
: translate inside SUIF from Fortran to C form.
- PORKY_UNUSED3
:
- S2C
: convert a SUIF file to C
- BACKEND_CC
: Use cc or gcc.
- LD
: ld.
(See the man pages provided with the SUIF distribution for more. Much of this data was gathered from the man pages.)
