[PATCH] D80735: [OpenMP][NFC] Reuse OMPIRBuilder `struct ident_t` handling in Clang

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 09:20:42 PDT 2020


jhuber6 added a comment.

Here's one of the stack traces. Calling `InternalOMPBuilder.initialize()` is what triggers it to start failing, which is confusing because all that function does is initialize the named types from OMPConstants, which should be working or else the old solution wouldn't work. Unless the compiler is just straight up optimizing out the Irbuilder without the initialize call which I find highly unlikely.

   #0 0x00007fc6b112701a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libLLVMSupport.so.11git+0x1b301a)
   #1 0x00007fc6b1124e54 llvm::sys::RunSignalHandlers() (/home/jhuber/Documents/llvm-project/build/bin/../lib/libLLVMSupport.so.11git+0x1b0e54)
   #2 0x00007fc6b1124f98 SignalHandler(int) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libLLVMSupport.so.11git+0x1b0f98)
   #3 0x00007fc6b517f800 __restore_rt (/usr/lib/libpthread.so.0+0x14800)
   #4 0x00007fc6b0aa0ce5 raise (/usr/lib/libc.so.6+0x3bce5)
   #5 0x00007fc6b0a8a857 abort (/usr/lib/libc.so.6+0x25857)
   #6 0x00007fc6b0a8a727 _nl_load_domain.cold (/usr/lib/libc.so.6+0x25727)
   #7 0x00007fc6b0a99426 (/usr/lib/libc.so.6+0x34426)
   #8 0x00007fc6b148c223 llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libLLVMCore.so.11git+0x1ce223)
   #9 0x00007fc6b41dc007 llvm::IRBuilderBase::CreateCall(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::MDNode*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x1c3007)
  #10 0x00007fc6b41eb3d6 clang::CodeGen::CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x1d23d6)
  #11 0x00007fc6b43acbf0 clang::CodeGen::CGOpenMPRuntime::emitTaskInit(clang::CodeGen::CodeGenFunction&, clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Function*, clang::QualType, clang::CodeGen::Address, clang::CodeGen::OMPTaskDataTy const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x393bf0)
  #12 0x00007fc6b43afb67 clang::CodeGen::CGOpenMPRuntime::emitTaskCall(clang::CodeGen::CodeGenFunction&, clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Function*, clang::QualType, clang::CodeGen::Address, clang::Expr const*, clang::CodeGen::OMPTaskDataTy const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x396b67)
  #13 0x00007fc6b43ff10d void llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&)>::callback_fn<clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective const&)::'lambda0'(clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&)>(long, clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e610d)
  #14 0x00007fc6b442facb clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&)> const&, clang::CodeGen::OMPTaskDataTy&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x416acb)
  #15 0x00007fc6b443034b clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x41734b)
  #16 0x00007fc6b43f9b73 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e0b73)
  #17 0x00007fc6b43f9fd4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e0fd4)
  #18 0x00007fc6b43fa3cf clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e13cf)
  #19 0x00007fc6b43fde5f clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e4e5f)
  #20 0x00007fc6b43f97f2 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e07f2)
  #21 0x00007fc6b4402811 emitBody(clang::CodeGen::CodeGenFunction&, clang::Stmt const*, clang::Stmt const*, int, int) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e9811)
  #22 0x00007fc6b440ce23 clang::CodeGen::CodeGenFunction::EmitOMPLoopBody(clang::OMPLoopDirective const&, clang::CodeGen::CodeGenFunction::JumpDest) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3f3e23)
  #23 0x00007fc6b440d180 void llvm::function_ref<void (clang::CodeGen::CodeGenFunction&)>::callback_fn<clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(clang::OMPLoopDirective const&, clang::Expr*, llvm::function_ref<std::pair<clang::CodeGen::LValue, clang::CodeGen::LValue> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&)> const&, llvm::function_ref<std::pair<llvm::Value*, llvm::Value*> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&, clang::CodeGen::Address, clang::CodeGen::Address)> const&)::'lambda0'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)::operator()(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) const::'lambda'(clang::CodeGen::CodeGenFunction&)>(long, clang::CodeGen::CodeGenFunction&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3f4180)
  #24 0x00007fc6b4409a8e clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(clang::Stmt const&, bool, clang::Expr const*, clang::Expr const*, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&)>, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&)>) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3f0a8e)
  #25 0x00007fc6b440a137 void clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(clang::OMPLoopDirective const&, clang::Expr*, llvm::function_ref<std::pair<clang::CodeGen::LValue, clang::CodeGen::LValue> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&)> const&, llvm::function_ref<std::pair<llvm::Value*, llvm::Value*> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&, clang::CodeGen::Address, clang::CodeGen::Address)> const&)::'lambda0'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)>(long, clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3f1137)
  #26 0x00007fc6b436722d clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&) const (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e22d)
  #27 0x00007fc6b43ffa4c void clang::CodeGen::RegionCodeGenTy::CallbackFn<emitCommonSimdLoop(clang::CodeGen::CodeGenFunction&, clang::OMPLoopDirective const&, clang::CodeGen::RegionCodeGenTy const&, clang::CodeGen::RegionCodeGenTy const&)::'lambda'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)>(long, clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e6a4c)
  #28 0x00007fc6b436722d clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&) const (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e22d)
  #29 0x00007fc6b440d83a emitCommonSimdLoop(clang::CodeGen::CodeGenFunction&, clang::OMPLoopDirective const&, clang::CodeGen::RegionCodeGenTy const&, clang::CodeGen::RegionCodeGenTy const&) (.constprop.0) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3f483a)
  #30 0x00007fc6b4429704 clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(clang::OMPLoopDirective const&, clang::Expr*, llvm::function_ref<std::pair<clang::CodeGen::LValue, clang::CodeGen::LValue> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&)> const&, llvm::function_ref<std::pair<llvm::Value*, llvm::Value*> (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&, clang::CodeGen::Address, clang::CodeGen::Address)> const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x410704)
  #31 0x00007fc6b4429b2c void clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPForDirective(clang::OMPForDirective const&)::'lambda'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)>(long, clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x410b2c)
  #32 0x00007fc6b436722d clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&) const (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e22d)
  #33 0x00007fc6b43674af (anonymous namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&, clang::Stmt const*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e4af)
  #34 0x00007fc6b43627ce clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, bool) (.part.0) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3497ce)
  #35 0x00007fc6b442d270 clang::CodeGen::CodeGenFunction::EmitOMPForDirective(clang::OMPForDirective const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x414270)
  #36 0x00007fc6b43f9a0b clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e0a0b)
  #37 0x00007fc6b4422ab9 void clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective const&)::'lambda2'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)>(long, clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x409ab9)
  #38 0x00007fc6b436722d clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&) const (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e22d)
  #39 0x00007fc6b43674af (anonymous namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&, clang::Stmt const*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x34e4af)
  #40 0x00007fc6b4433dd3 clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt const&, clang::SourceLocation) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x41add3)
  #41 0x00007fc6b43958a0 emitParallelOrTeamsOutlinedFunction(clang::CodeGen::CodeGenModule&, clang::OMPExecutableDirective const&, clang::CapturedStmt const*, clang::VarDecl const*, llvm::omp::Directive, llvm::StringRef, clang::CodeGen::RegionCodeGenTy const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x37c8a0)
  #42 0x00007fc6b4395a16 clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective const&, clang::VarDecl const*, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x37ca16)
  #43 0x00007fc6b441e806 emitCommonOMPParallelDirective(clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&, llvm::SmallVectorImpl<llvm::Value*>&)> const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x405806)
  #44 0x00007fc6b44314ac clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4184ac)
  #45 0x00007fc6b43f9d53 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e0d53)
  #46 0x00007fc6b43f9fd4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x3e0fd4)
  #47 0x00007fc6b4456981 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x43d981)
  #48 0x00007fc6b446545e clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x44c45e)
  #49 0x00007fc6b44beed6 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4a5ed6)
  #50 0x00007fc6b44bc015 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4a3015)
  #51 0x00007fc6b44bc48b clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4a348b)
  #52 0x00007fc6b44c32a2 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4aa2a2)
  #53 0x00007fc6b4545439 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x52c439)
  #54 0x00007fc6b444363e clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x42a63e)
  #55 0x00007fc6aeb78ac4 clang::ParseAST(clang::Sema&, bool, bool) (/home/jhuber/Documents/llvm-project/build/bin/../lib/../lib/libclangParse.so.11git+0x34ac4)
  #56 0x00007fc6b44509e8 clang::CodeGenAction::ExecuteAction() (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangCodeGen.so.11git+0x4379e8)
  #57 0x00007fc6b2bfbe09 clang::FrontendAction::Execute() (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangFrontend.so.11git+0x10be09)
  #58 0x00007fc6b2bab20e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangFrontend.so.11git+0xbb20e)
  #59 0x00007fc6b5166e73 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/jhuber/Documents/llvm-project/build/bin/../lib/libclangFrontendTool.so.11git+0x4e73)
  #60 0x00005617a122c2cf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/jhuber/Documents/llvm-project/build/bin/clang-11+0x152cf)
  #61 0x00005617a12294b8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/jhuber/Documents/llvm-project/build/bin/clang-11+0x124b8)
  #62 0x00005617a122610e main (/home/jhuber/Documents/llvm-project/build/bin/clang-11+0xf10e)
  #63 0x00007fc6b0a8c023 __libc_start_main (/usr/lib/libc.so.6+0x27023)
  #64 0x00005617a1228ffe _start (/home/jhuber/Documents/llvm-project/build/bin/clang-11+0x11ffe)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80735/new/

https://reviews.llvm.org/D80735





More information about the cfe-commits mailing list