[all-commits] [llvm/llvm-project] 7b70fc: [mlir][OpenMP] Convert omp.cancel sections to LLVM...

Tom Eccles via All-commits all-commits at lists.llvm.org
Tue Apr 29 09:20:01 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b70fc74d039dbb0c3c67feb1741bb5c446d55f7
      https://github.com/llvm/llvm-project/commit/7b70fc74d039dbb0c3c67feb1741bb5c446d55f7
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

  Changed paths:
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/openmp-cancel.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (#137193)

This is quite ugly but it is the best I could think of. The old
FiniCBWrapper was way too brittle depending upon the exact block
structure inside of the section, and could be confused by any control
flow in the section (e.g. an if clause on cancel). The wording in the
comment and variable names didn't seem to match where it was actually
branching too as well.

Clang's (non-OpenMPIRBuilder) lowering for cancel inside of sections
branches to a block containing __kmpc_for_static_fini.

This was hard to achieve here because sometimes the FiniCBWrapper has to
run before the worksharing loop finalization has been crated.

To get around this ordering issue I created a dummy branch to a dummy
block, which is then fixed later once all of the information is
available.



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