[all-commits] [llvm/llvm-project] 19756e: [OpenMP][IRBuilder] Support allocas in nested para...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Thu Jul 30 08:21:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 19756ef53a498b7aa1fbac9e3a7cd3aa8e110fad
      https://github.com/llvm/llvm-project/commit/19756ef53a498b7aa1fbac9e3a7cd3aa8e110fad
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

  Log Message:
  -----------
  [OpenMP][IRBuilder] Support allocas in nested parallel regions

We need to keep track of the alloca insertion point (which we already
communicate via the callback to the user) as we place allocas as well.

Reviewed By: fghanim, SouraVX

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


  Commit: ebad64dfe133e64d1df6b82e6ef2fb031d635b08
      https://github.com/llvm/llvm-project/commit/ebad64dfe133e64d1df6b82e6ef2fb031d635b08
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/test/OpenMP/cancel_codegen.cpp
    A clang/test/OpenMP/irbuilder_nested_parallel_for.c
    M clang/test/OpenMP/task_codegen.cpp

  Log Message:
  -----------
  [OpenMP][FIX] Consistently use OpenMPIRBuilder if requested

When we use the OpenMPIRBuilder for the parallel region we need to also
use it to get the thread ID (among other things) in the body. This is
because CGOpenMPRuntime::getThreadID() and
CGOpenMPRuntime::emitUpdateLocation implicitly assumes that if they are
called from within a parallel region there is a certain structure to the
code and certain members of the OMPRegionInfo are initialized. It might
make sense to initialize them even if we use the OpenMPIRBuilder but we
would preferably get rid of such state instead.

Bug reported by Anchu Rajendran Sudhakumari.

Depends on D82470.

Reviewed By: anchu-rajendran

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


Compare: https://github.com/llvm/llvm-project/compare/622e46156d9a...ebad64dfe133


More information about the All-commits mailing list