[llvm-dev] Orc JIT v2 breaks OpenMP in 11.x branch?

Geoff Levner via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 3 05:28:28 PDT 2020


Greetings, Lang and other JITters,

Last week I moved our Orc v2-based app from top-of-tree to the new
11.x branch, and it no longer handles C++ code containing OpenMP
directives correctly.

More specifically, if I JIT compile a function containing OpenMP
parallel/for pragmas, using a release version of LLVM, the code
compiles and seems to work, but if I try to write the module's bitcode
to file, I get the following error message:

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

If I use a debug version of LLVM, compilation fails with a broken assertion:

    .../llvm/lib/IR/Instructions.cpp:455: void
llvm::CallInst::init(llvm::FunctionType*, llvm::Va
lue*, llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const
llvm::Twine&): Assertion `(i >
= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType())
&& "Calling a function with a bad signature!"' failed.

The same code compiles correctly using clang from the command line. It
also works fine using Orc v2 in the master branch of LLVM from the end
of May.

The problems are way too deep in the LLVM code for me to make any
sense of them... Does anybody else have a clue what might have
happened to Orc and/or OpenMP in the past couple months to trigger
this?

Geoff


More information about the llvm-dev mailing list