• Keine Ergebnisse gefunden

FLOW ANALYSIS

Im Dokument TABLE OF (Seite 43-52)

CXT COMPILED INSTRUCTION TABLE

FLOW ANALYSIS

Example 1 (--.

, GO

TO

6

O(t1

DIMENSION

X (5)

0 ( + 2 FORMAT (F8.3)

More non- executable statements.

A brief flow analysis i s performed using the information in the ALPHA, BETA, and NONEXC tables. Each &in the ALPHA table i s the termination of a path of flow in the source program. Therefore, t h e r e m u s t be a t r a n s f e r t o the f i r s t executable statement following each O(in the ALPHA table. That i s , that the IFN&+M in Example 1 must be in the BETA table, since

6

Is a r e state- ments t r a n s f e r r e d to. In reference to Example 1, the flow a n a l y s i s p r o c e s s o r w i l l f i r s t ecarch the BETA table f o r

&

+1. Not finding O(t1 in the

BETA

table, i t w i l l then s e a r c h for d t l in the

NONEXC

table, and a match will be found, Upon finding K4-1in the NONEXC table, the p r o c e s s o r w i l l then follow the same procedure f o r 4 4 - 2 , c X t 3 , .

. . . . . , t M .

In searching for,::=!,+^, i f the p r o c e s s o r finds i t in the BETA table, the p r o c e s s o r will then proceed to execute a flow analysis for the next &in the ALPHA table. However, i f ( : L + ~ ie' not i n thd

BETA

table, and since i t i s an executable statement. O(,+M will not be in the NONEXC tabld.. Therefore, i f i + ~ i s not in either the BETA o r NONEXC tables, i t i s a p a r t of the program not reached, i. e.

,

an executable statement with no path of flow to it. If any e r r o r s a r e found, they a r e e n t e r e d in the e r r o r l i s t by the NOBETA routine. TIFGO w a s retained in c o r e f r o m Section 1'.

-

TDO

The TDO table i s examined f o r DO statements that specify a n illegal

@.

The

t h r e e legal r e f e r e n c e s checked for by Section I" a r e :

1. That the IFN n

\?

exists. i. e . , that the reference Q i s not zero.

2. That the IFN

@

i s executable, i. e.

,

that the reference @is not in the NON- E X C table.

3. That the IFN

@

i s not a t r a n s f e r ,

STOP,

o r RETURN statement, i. e., that the reference

6

is not in the ALPHA table.

If any e r r o r s a r e found, theyare entered in the e r r o r list by both NOBETA and

<DO

e r o u t i n e s , i n that order. TDO i s r e a d from the 5th file on tape

BZ.

F R E T

The number of branches for a

TIFGO

statement i s saved i n the A L P H A table with the I F N during the s c a n of

TIFGO.

Section I t ' i g n o r e s statement num- b e r s in the F R E T table which a r e not in the ALPHA table, but s a v e s any s t a t e - ment number w h e r e the count of branches in F R E T i s g r e a t e r than the count of branches shown in the ALPHA table Section IV ignores e x t r a frequencies given f o r s t a t e m e n t s other than

TIFGO

statements, but would be conlused by m i s - information generated when t h e r e a r e move frequencies given than t h e r e a r e branches. If any e r r o r s a r e ound, they a r e entered in the e r r o r l i s t by the NOBETA routine. F R E T is read from the 5th file on tape

B2.

EQUIT

--

If Section I' h a s found any inconsistent equivalences when assembling the

EQUIT

table, i t s e t s an e r r o r flag a t the beginning of the table and only e n t e r s those v a r i a b l e names which a r e e r r o n e o u s , and s e t s another flag a t the end of the list.

The e r r o r s a r e e n t e r e d i n the e r r o r 'list by the

E R R O R

routine. The

EQUIT TABLE

i s r e a d f r o m the 5th file on tape B2.

If any e r r o r s have been found in Section I", i t s p a c e s the System Tape to the diagnostic and r e a d s in D001. This is the only section of

FORTRAN

that d o e s not u s e the usual diagnostic c a l l e r . If no e r r o r s have been found, tape B2 is spaced over the 5th end of file n a r k and control is t r a n s f e r r e d t o 1-CS t o con- tinue comp ilation.

FLOW IN SECTION I

SECTION 11

F u r t h e r .complications m a y reeult f r o m the t r a n s f e r s out of D o ' s w h e r e additional indexing and saving inetructions will be required. The

TIFGO

file that will be compiled in Section 111 will contain the instructions n e c e s s - a r y f o r doing this. The

TIFGO

file will be made up f r o m information paseed on to i t in the TRASTO and

TRALEV

tables c r e a t e d i n t h i s Section.

C. Relative Cons tant s

A considerable portion of the work of Section 11 i s devoted t o the p r o p e r handling of s u b s c r i p t combinations which a r e called relative constants. A Relative

constant i s a subscript symbol not under control of a DO on that symbol.

That i a , i t r e c e i v e s i t s definition in s o m e fashion other than the indexing normally associated with a DO. A subscript combination m a y , t h e r e f o r e , be a p u r e relative constant (where none of i t s symbols i s under control of a

DO),

a mixed relative constant (where a t l e a s t one i s not under control of a DO while the o t h e r s a r e ) , o r a n o r m a l DO- subscript combination (where a l l eubscript eymbols a r e under control of a DO).. E a c h of t h e s e t h r e e types r e q u i r e s i t s own mode of t r e a t m e n t by Section 11.

The

FORVAL

table is the

key

in determining the point of definition of relative constants.

The DOFILE (C) file generated in Block

IV

contains the inetructions n e c e s e r a r y for the

COMPUTATION

of the subscripted variable load value.

F L O W WITHIN

SECTION

11

To c a r r y out the analysis and to deal with the various complexititea involved, t h e r e a r e s i x logical blocks i n Section 11.

BLOCK 1 Nest analysie, flow analysis.

BLOCK 2 Subscript combination analysis.

BLOCK 3 Relative constant subscript analysis.

BLOCK 4 Compilation of subrouiines f o r computing relative constant index value s.

BLOCK

5

Compilation of loop initialization, incrementing and testing instructions.

BLOCK

6

Reordering the DO file f o r input to Section IIL BLOCK

I

The task of this block i s to examine the DO nesting s t r u c t u r e and the flow of the program. This information which Section I extracted f r o m DO state- m e n t s and Input-Output l i s t s i s contained i n the tape table TDO, which on

being read in, i e further expanded into the 9 word table DOTAG to accommodate

the r e s u l t s of analysis. The DO i s scanned to d e t e r m i n e i f i t contains o t h e r

T o p r o c e s s the f i r s t situation above the FORTAG table e n t r i e s a r e s e l e c t e d one a t a time. It i s only n e c e s s a r y to look a t the ones not p r o c e s s e d by Block 11. T h c

FORVAL

table is then s e a r c h e d f o r the o c c u r r e n c e of t h e p a r t i c u l a r F O R T A G entry. If one i s found an entry i s made i n a table called TSXCOM. T h i s table enables Section 111 to compile a

TSX

to a subroutine which will compute the c u r r e n t index value f o r the tag. The subroutine i s

compiled by Block IV.

T h c r e m a i n d e r of t h i s Block i s devoted to the second method of defining a r e l a t i v e constant. All

FORTAG

table e n t r i e s not p r o c e s s e d by Block I1 o r the p r e v i o u s p a r t of t h i s Block, a r e now s e l e c t e d one a t a t i m e . The DOTAG table i s then s e a r c h e d for a DO f o r one of the FORTAG symbols. If s u c h a DO i s found a s e a r c h i s then m a d e to find a t r a n s f e r out of t h i s DO. When such a t r a n s f e r i s found a n e n t r y i s m a d e in the TRASTO t a b l e t o indicate t o Block IV what kind of subroutines will be n e c e s s a r y f o r the above conditions.

T h e t a b l e s g e n e r a t e d by Block XI1 a r e c a r r i e d o v e r t o Block I V as m e m o r y t a b l e s.

BLOCK

IV

Thie Block will p r o c e s s the t a b l e s g e n e r a t e d in Block I11 and compile the sub- routi n e s n e c e s s a r y f o r computing r e l a t i v e constant index values. T h e sub- r o u t i n e s a r e now w r i t t e n out on tape B 2 f i l e s 8 and 9 a s t h e DOFILE (C) a n d i t s r e c o r d count.

BLOCK V

Thie Block c o m p i l e s t h e n e c e s s a r y indexing i n s t r u c t i o n s f o r the t a g s , using t h e r e s u l t s of the s u b s c r i p t and flow a n a l y s i s provided by Blocks I and 11. The information n e c e s s a r y f o r t h i s compilation is contained in t h e TAGTAG and DOTAG t a b l e s which a r e on tape A4 and

B2

respectively.

The p r o c e s s i s broken down into two p h a s e s . The f i r s t being the alpha which p r o v i d e s the loading and initializing i n s t r u c t i o n s a t t h e beginning of a DO. T h e second i s the Beta phase which compiles the i n c r e m e n t i n g , t e s t i n g and r e s e t t i n g i n s t r u c t i o n s a t the end of a DO, ( i . e. , TXI, T X L and TIX r e s p e c t i v e l y . )

The CITs a r e now complete a s f a r a s D O ' S a r e c o n c e r n e d and a , r e now w r i t t e n out onto tape B 3 a s the f i r s t file. T h e s e a r e i n r e v e r s e o r d e r , and a r e l e f t t h i s way f o r Block V I t o take c a r e of.

BLOCK VI

The o r d e r in which Block 5 c o m p i l e s DO i n s t r u c t i o n s f o r a n e s t i s t h e backward sequence of o(and

(3

of the n e s t , although within each& and

()

block, t h e i n s t r u c - t i o n s a r e i n t h e n a t u r a l o r d e r .

he&

a n d @ blocks of C I T t s m u s t t h e r e f o r e be i n v e r t e d , s o that Section I11 can m e r g e t h e DO file with the

COMPAIL

file, output

51

by Section I.

The

beginning of each block i s marked by an a l l one's CIT entry, and after reading a neat of

CIT's

(the end of a nest being marked by z e r o s ) , Block VI searches from the end of a nest until an all o n e ' s fence i s found, The instructions just scanned are output a6 the DO f i l e , and would correspond to the f i r s t w o f the nest, Block

VI

then looks for another fence, and 8 0 on, until the whole nest i a output. W h e n the DO file i s complete,

control

passes to Section

111.

R K A D T l P O O T R A D T D O F O R V A L F O R T A O ( F I L E I )

OoTAo ( A ) (FILL I)

D O Y A O ( A ) ( C I L L 1)

S E C T I O N I I BLOCK Ill

I

DOYAG (e)

R E C O R D O O U N ( F I L E 7)

OOTAQ ( 8 ) ( F I L E 6)

B E C T I O N 11

I

LOCK 1V

DOC l L E ( F I L L I)

DOTAG (o) V I L E 6

'DOTAG (B) REcORO COUNT ( F I L S 7 )

D O F I L E ( C ) ( P I L E 6 ) P O F I L E (C) RSCORO C O U N T ( F I L E a)

t

S E C T I O N Ill ( F I G . II)

FIGURE 10

SECTION III 2.01. 05

Im Dokument TABLE OF (Seite 43-52)