[all-commits] [llvm/llvm-project] 96bc07: [MLIR][OpenMP] Add canonical loop LLVM-IR lowering...

Michael Kruse via All-commits all-commits at lists.llvm.org
Fri Jul 11 03:54:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96bc07d49221dc40eb751e0759be2ccbb8a64f00
      https://github.com/llvm/llvm-project/commit/96bc07d49221dc40eb751e0759be2ccbb8a64f00
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
    M mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    A mlir/test/Target/LLVMIR/openmp-cli-canonical_loop.mlir
    A mlir/test/Target/LLVMIR/openmp-cli-unroll-heuristic01.mlir
    A mlir/test/Target/LLVMIR/openmp-cli-unroll-heuristic02.mlir

  Log Message:
  -----------
  [MLIR][OpenMP] Add canonical loop LLVM-IR lowering (#147069)

Support for translating the operations introduced in #144785 to LLVM-IR.

In order to keep the lowering simple,
`OpenMPIRBuider::unrollLoopHeuristic` is applied when encountering the
`omp.unroll_heuristic` op. As a result, the operation that unrolling is
applied to (`omp.canonical_loop`) must have been emitted before even
though logically there is no such requirement.

Eventually, all transformations on a loop must be applied directly after
emitting `omp.canonical_loop`, i.e. future transformations must be
looked-up when encountering `omp.canonical_loop` itself. This is because
many OpenMPIRBuilder methods (e.g. `createParallel`) expect all the
region code to be emitted withing a callback. In the case of
`createParallel`, the region code is getting outlined into a new
function. Therefore, making the operation order a formal requirement
would not make the implementation any easier.



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