[Openmp-dev] LLVM openMP entry point

Jose Diaz via Openmp-dev openmp-dev at lists.llvm.org
Thu Jun 24 08:22:58 PDT 2021


What do you mean by entry point? It depends on what you're interested in
modifying. Others can correct me if I'm wrong but:

If you just want to modify the runtime, files will be under /openMP (
https://github.com/llvm/llvm-project/tree/main/openmp)

If you want to add new clauses you need to focus more on clang, code
generation and such. Some files of interest are:

https://github.com/llvm/llvm-project/blob/main/clang/lib/Parse/ParseOpenMP.cpp

https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaOpenMP.cpp
 https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/DeclOpenMP.cpp
 https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/StmtOpenMP.cpp

https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGOpenMPRuntime.cpp
(and header)

https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
(and the corresponding vendor specific files for offloading in the same
folder (e.g. AMDGCN and NVPTX)
 https://github.com/llvm/llvm-project/tree/main/llvm/lib/Frontend/OpenMP
and
https://github.com/llvm/llvm-project/tree/main/llvm/include/llvm/Frontend/OpenMP

If you are more interested in optimizations, this is where I know too
little, but one file I remember is:

https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
and its header in /llvm/include

Other people can chime in with more ideas or files I may be missing.

My recommendation is use Godbolt a lot: Here are some examples:
https://godbolt.org/z/sWsYaz7rK
https://godbolt.org/z/YW9o1bqdx

There you can see what is being called at runtime, as well as the LLVMIR
representation.

I hope this helps

On Thu, Jun 24, 2021 at 9:23 AM Krzysztof Rymski via Openmp-dev <
openmp-dev at lists.llvm.org> wrote:

> Hi,
> I want to do a project with OpenMP where I add speculation with
> transactional memory, but I have a hard time finding an entry point to the
> omp library.
> Therefore, I was hoping you could point me to it.
>
> Best wishes
> Krzysztof
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20210624/f2fc7bbb/attachment.html>


More information about the Openmp-dev mailing list