[all-commits] [llvm/llvm-project] 9548b7: [OpenMP] Introduce the OpenMPOpt transformation pass

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Sat Feb 8 12:48:10 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9548b74a831ea005649465797f359e0521f3b8a9
      https://github.com/llvm/llvm-project/commit/9548b74a831ea005649465797f359e0521f3b8a9
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-02-08 (Sat, 08 Feb 2020)

  Changed paths:
    M llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
    M llvm/include/llvm/InitializePasses.h
    M llvm/include/llvm/LinkAllPasses.h
    M llvm/include/llvm/Transforms/IPO.h
    A llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
    M llvm/lib/LTO/LTOCodeGenerator.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/CMakeLists.txt
    M llvm/lib/Transforms/IPO/IPO.cpp
    M llvm/lib/Transforms/IPO/LLVMBuild.txt
    A llvm/lib/Transforms/IPO/OpenMPOpt.cpp
    M llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/opt-O2-pipeline.ll
    M llvm/test/Other/opt-O3-pipeline.ll
    M llvm/test/Other/opt-Os-pipeline.ll
    M llvm/test/Other/pass-pipelines.ll
    A llvm/test/Transforms/OpenMP/gtid.ll

  Log Message:
  -----------
  [OpenMP] Introduce the OpenMPOpt transformation pass

The OpenMPOpt pass is a CGSCC pass in which OpenMP specific
optimizations can reside.

The OpenMPOpt pass uses the OpenMPKinds.def file to identify runtime
calls and their uses. This allows targeted transformations and eases
their implementation.

This initial patch deduplicates `__kmpc_global_thread_num` and
`omp_get_thread_num` calls. We can also identify arguments that are
equivalent to such a call result and use it instead. Later we can
determine "gtid" arguments based on the use in kernel functions etc.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D69930




More information about the All-commits mailing list