[all-commits] [llvm/llvm-project] 40c7dd: [flang] Delete a trailing CYCLE that is the last s...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Fri Sep 11 15:29:22 PDT 2026


  Branch: refs/heads/users/ergawy/pft-delete-trailing-cycle
  Home:   https://github.com/llvm/llvm-project
  Commit: 40c7dd251353dd4428b792764bbeb1d897a23df2
      https://github.com/llvm/llvm-project/commit/40c7dd251353dd4428b792764bbeb1d897a23df2
  Author: ergawy <kareem.ergawy at gmail.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M flang/lib/Lower/PFTBuilder.cpp
    A flang/test/Lower/OpenMP/trailing-cycle.f90
    A flang/test/Lower/trailing-cycle.f90

  Log Message:
  -----------
  [flang] Delete a trailing CYCLE that is the last statement of its DO

A CycleStmt at the end of the body of its own DoConstruct is a no-op:
branching to the EndDoStmt and falling through to it are the same thing.
Branch analysis nonetheless marks the DoConstruct unstructured, which
costs the structured form of the loop and the induction variable
semantics that later passes rely on.

Delete such a CycleStmt in the PFT. The statement
must be unlabeled, so that it is not itself a branch target, and it must
name either no construct or this one.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list