[llvm-bugs] [Bug 47134] New: OpenMP support is broken for JIT-compiled modules

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 12 04:53:31 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47134

            Bug ID: 47134
           Summary: OpenMP support is broken for JIT-compiled modules
           Product: OpenMP
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: glevner at gmail.com
                CC: llvm-bugs at lists.llvm.org

A commit from June 1, 2020 breaks the JIT compilation of C++ modules using
OpenMP parallel/for pragmas. This affects top-of-tree users as well as users of
branch 11.x.

The commit is 1a4fb2edcb908d6c9141036d29b46a347b1b6f18:

   Summary: This changes Clang's generation of OpenMP runtime functions
   to use the types and functions defined in OpenMPKinds and
   OpenMPConstants. New OpenMP runtime function information should now be
   added to OMPKinds.def. This patch also changed the definitions of
   __kmpc_push_num_teams and __kmpc_copyprivate to match those found in
   the runtime.

When using a release version of LLVM, if you use Orc v2 to JIT compile a module
containing a parallel/for pragma, the code compiles and seems to work, but if
you try to save the bitcode to file, you get the following error:

   Invalid record (Producer: 'LLVM11.0.0' Reader: 'LLVM 11.0.0')

With a debug version of LLVM, compilation fails with a broken assertion at line
455 of llvm/lib/IR/Instructions.cpp: "Calling a function with a bad signature!"

Johannes Doerfert's patch (https://reviews.llvm.org/D80735) seems to fix the
problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200812/c8304038/attachment.html>


More information about the llvm-bugs mailing list