[all-commits] [llvm/llvm-project] 1b62ea: [flang][acc] Fix crash on collapse(force:N) with n...

khaki3 via All-commits all-commits at lists.llvm.org
Fri Apr 17 10:42:08 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b62eaa2bf051a8207c86454ede3420e9f9d4886
      https://github.com/llvm/llvm-project/commit/1b62eaa2bf051a8207c86454ede3420e9f9d4886
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    M flang/include/flang/Lower/OpenACC.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/OpenACC.cpp
    M flang/test/Lower/OpenACC/acc-loop-collapse-force-lowering.f90
    A flang/test/Lower/OpenACC/acc-loop-collapse-force-non-tightly-nested.f90
    M flang/test/Semantics/OpenACC/acc-collapse-force.f90

  Log Message:
  -----------
  [flang][acc] Fix crash on collapse(force:N) with non-tightly nested loops (#191310)

When collapse(force:N) is applied to non-tightly nested loops, the
compiler could crash or generate redundant inner loops.

Crashes occurred because getNestedEvaluations() was called without
checking hasNestedEvaluations() first. Add guards in hasEarlyReturn(),
createRegionOp(), and the collapse-force sinking logic in Bridge.cpp.

Redundant inner loops were generated because processDoLoopBounds
absorbed N levels of do-loops into the outer acc.loop, but the PFT
walker still generated separate acc.loop ops for those same loops.
Fix by tracking absorbed DoConstruct* pointers in visitLoopControl
and skipping them in genFIR(DoConstruct).



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