[all-commits] [llvm/llvm-project] f7daa9: [mlir][OpenMP] fix crash outlining infinite loop (...

Tom Eccles via All-commits all-commits at lists.llvm.org
Fri Mar 7 03:03:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7daa9d302a82f35c3b9ed4cede23ab808462b4f
      https://github.com/llvm/llvm-project/commit/f7daa9d302a82f35c3b9ed4cede23ab808462b4f
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2025-03-07 (Fri, 07 Mar 2025)

  Changed paths:
    M clang/test/OpenMP/cancel_codegen.cpp
    M clang/test/OpenMP/irbuilder_nested_openmp_parallel_empty.c
    M clang/test/OpenMP/irbuilder_nested_parallel_for.c
    M clang/test/OpenMP/nested_loop_codegen.cpp
    M clang/test/OpenMP/parallel_codegen.cpp
    M clang/test/OpenMP/taskgroup_codegen.cpp
    M flang/test/Integration/OpenMP/parallel-private-reduction-worstcase.f90
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/test/Transforms/OpenMP/parallel_region_merging.ll
    M mlir/test/Target/LLVMIR/openmp-llvm.mlir
    A mlir/test/Target/LLVMIR/openmp-outline-infinite-loop.mlir
    M mlir/test/Target/LLVMIR/openmp-parallel-reduction-multiblock.mlir
    M mlir/test/Target/LLVMIR/openmp-reduction-array-sections.mlir
    M mlir/test/Target/LLVMIR/openmp-reduction-init-arg.mlir
    M mlir/test/Target/LLVMIR/openmp-reduction-sections.mlir

  Log Message:
  -----------
  [mlir][OpenMP] fix crash outlining infinite loop (#129872)

Previously an extra block was created by splitting the previous exit
block. This produced incorrect results when the outlined region
statically never terminated because then there wouldn't be a valid exit
block for the outlined region, this caused this newly added block to
have an incoming edge from outside of the outlining region, which caused
outlining to fail.

So far as I can tell this extra block no longer serves any purpose. The
comment says it is supposed to collate multiple control flow edges into
one place, but the code as it is now does not achieve this. In fact, as
can be seen from the changes to lit tests, this block was not actually
outlined in the end. This is because there are actually two code
extractors: one in the callback for creating a parallel op which is used
to find what the input/output variables are (which does have this block
added to it), and another one which actually does the outlining (which
this block was not added to).

Tested with the gfortran and fujitsu test suites.

Fixes #112884



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