Paul Brook <[EMAIL PROTECTED]>: > On Wednesday 20 July 2005 15:35, Canqun Yang wrote: > > Hi, all > > > > Function inlining for FORTRAN programs always fails. > > Not entirely true. Inlining of contained procedures works fine (or it did la > st > time I checked). This should include inlining of siblings within a module. > > > If no one engages in it, I will give a try. Would you please give me > > some clues? > > The problem is that each top level program unit (PU)[1] is compiled > separately. Each PU has it's own "external" decls for all function calls, > even if the function happens to be in the same function. Thus each PU is an > > isolated self-contained tree structure, and the callgraph doesn't know the > definition and declaration are actually the same thing. > > Basically what you need to do is parse the whole file, then start generating > > code. > > Unfortunately this isn't simple (or it would have been fixed already!). > Unlike C Fortran doesn't have file-level scope. It makes absolutely no > difference whether two procedures are in the same file, or in different > files. You get all the problems that multifile IPA in C experiences within > a > single Fortran file. > > The biggest problem is type consistency and aliasing. Consider the following >
I have several FORTRAN 77 programs. After inlining the small functions in them by hand, they made a great performance improvements. So I need a trial implementation of function inlining to verify the effectiveness of it. Now, my question is: If we just take the FORTRAN 77 syntax into account (no derived types, no complex aliasing), may it be simpler to implement function inlining for FORTRAN 77. > > Paul > Canqun Yang Creative Compiler Research Group. National University of Defense Technology, China.