[Flang-dev] RFC: lowering Fortran AST to an IR

Roger Ferrer Ibáñez rofirrim at gmail.com
Wed Oct 24 17:27:07 EDT 2018


Hi Eric,

thanks a lot for sharing pointers to these documents.

I was curious about the scope transitions. If I'm reading it right, it
means that the control flow graph encodes the active scope of the current
basic block. Is my understanding correct?

If so, doesn't it become a bit complicated to maintain in the presence of
transfers of control flow that cross the boundary of a scope?

I was thinking of an example like this

program main
    implicit none
    integer :: x, i
    integer, external :: fun

    do i = 1, 10
      block
          integer :: y
          y = i + 1
          print *, y
          if (i < fun()) exit
      end block
   end do
   print *, "end"
end program main

Would the exit have to cross first a SCOPE_EXIT (I presume there would be
one for the 'end block') before jumping to the 'print *, "end"'?

Kind regards,
Roger

Missatge de Eric Schweitz (PGI) <eric.schweitz at pgroup.com> del dia dc., 24
d’oct. 2018 a les 21:42:

> The f18 project has a high-level design document out for several months on
> an intermediate representation for lowering and optimizing Fortran ASTs.
> The document can be found here: https://bit.ly/2q9IRaQ
>
>
>
> Some context for this document can be found in the github documentation
> at: https://github.com/flang-compiler/f18/tree/master/documentation
>
> Of particular note:
>
> * Parsing: https://bit.ly/2ERlXyO
>
> * Semantics: https://bit.ly/2CAybcB
>
> * Label Resolution: https://bit.ly/2PlXQfP
>
>
>
> The purpose of the f18 CFG will be to lower Fortran surface syntax into an
> semantically clean operational structure amenable to high-level
> transformations and further lowering into LLVM-IR.
>
>
>
> As the project continues to move forward, we would like to know of if
> there are any relevant thoughts, concerns, or questions.
>
>
>
> --
>
> Eric
>
>
> ------------------------------
> This email message is for the sole use of the intended recipient(s) and
> may contain confidential information.  Any unauthorized review, use,
> disclosure or distribution is prohibited.  If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message.
> ------------------------------
> _______________________________________________
> flang-dev mailing list
> flang-dev at lists.flang-compiler.org
>
> http://lists.flang-compiler.org/mailman/listinfo/flang-dev_lists.flang-compiler.org
>


-- 
Roger Ferrer Ibáñez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/attachments/20181024/518bbfbf/attachment-0001.html>


More information about the flang-dev mailing list