Fortran: The Road Ahead.

Orn E. Hansen oe.hansen@oehansen.pp.se
Sun Dec 7 17:04:00 GMT 1997


>       do i = 1, n
>          <body1>
>          if (lcond) then
>             <body2>
>          else
>             <body3>
>          endif
>          <body4>
>       enddo

  You could select variant I, if lcond will always yield the same
condition for any i.  And II if <body1> and <body4> are independant
and not products of <body2> or <body4>.  The save goes from O(4n)
downto O(3n + 1), which can be great for a large n (or expensive
lcond).  But most times, <body4> will use a product of in-loop
condition of <body2> or <body4> (hence it's position), making a
transformation impossible.

----------------------------------------------------------------------------
Orn Einar Hansen                         oe.hansen@oehansen.pp.se
                                          oehansen@daimi.aau.dk
                                        voice+fax; +46 035 217194




More information about the Gcc mailing list