This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][NFC] Reuse OMPIRBuilder `struct ident_t` handling in Clang
ClosedPublic

Authored by jdoerfert on May 28 2020, 9:15 AM.

Details

Summary

Replace the ident_t handling in Clang with the methods offered by the
OMPIRBuilder. This cuts down on the clang code as well as the
differences between the two, making further transitions easier. Tests
have changed but there should not be a real functional change. The most
interesting difference is probably that we stop generating local ident_t
allocations for now and just use globals. Given that this happens only
with debug info, the location part of the ident_t is probably bigger
than the test anyway. As the location part is already a global, we can
avoid the allocation, memcpy, and store in favor of a constant global
that is slightly bigger. This can be revisited if there are
complications.

Diff Detail

Event Timeline

jdoerfert created this revision.May 28 2020, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2020, 9:15 AM
jdoerfert updated this revision to Diff 267349.May 29 2020, 1:08 PM

Replace all ident_t handling

Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2020, 1:08 PM
jhuber6 added inline comments.May 29 2020, 1:32 PM
clang/lib/CodeGen/CGOpenMPRuntime.h
376

Should D80222 be changed to use this instead and remove the static methods?

jdoerfert retitled this revision from [OpenMP][NFC] Reuse `llvm::omp::types::IdentPtr` in clang to [OpenMP][NFC] Reuse OMPIRBuilder `struct ident_t` handling in Clang.May 29 2020, 1:54 PM
jdoerfert edited the summary of this revision. (Show Details)
jdoerfert marked an inline comment as done.
jdoerfert added inline comments.
clang/lib/CodeGen/CGOpenMPRuntime.h
376

Good catch! Please copy this into D80222, use it instead of making the methods static, and commit the entire thing. For this change static is no option so it makes sense to just use it all over :)

I'm just investigating migrating D80222 away from the static methods. When I try to just add an OpenMPIRBuilder type and initialize it I get failures on the tests. I'm just adding in the module as you have
CGOpenMPRuntime.h

llvm::OpenMPIRBuilder InternalOMPBuilder;

CGOpenMPRuntime.cpp

CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM, StringRef FirstSeparator,
                                 StringRef Separator)
    : CGM(CGM), FirstSeparator(FirstSeparator), Separator(Separator),
      InternalOMPBuilder(CGM.getModule()), OffloadEntriesInfoManager(CGM) {
  InternalOMPBuilder.initialize();

But it causes most of the tests to fail even without using the IRBuilder object.

I'm just investigating migrating D80222 away from the static methods. When I try to just add an OpenMPIRBuilder type and initialize it I get failures on the tests. I'm just adding in the module as you have
CGOpenMPRuntime.h

llvm::OpenMPIRBuilder InternalOMPBuilder;

CGOpenMPRuntime.cpp

CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM, StringRef FirstSeparator,
                                 StringRef Separator)
    : CGM(CGM), FirstSeparator(FirstSeparator), Separator(Separator),
      InternalOMPBuilder(CGM.getModule()), OffloadEntriesInfoManager(CGM) {
  InternalOMPBuilder.initialize();

But it causes most of the tests to fail even without using the IRBuilder object.

That is interesting but hard to diagnose. Btw. if you use the OMPIRBuilder it could be that the missing insertion point is the problem, see the changes I made to IRBuilder(Base). If not, we need to look at the test failures more closely.

The failure message is pretty much always this assertion as far as I can tell

clang-11: /home/jhuber/Documents/llvm-project/llvm/lib/IR/Instructions.cpp:439: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, 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 failure message is pretty much always this assertion as far as I can tell

clang-11: /home/jhuber/Documents/llvm-project/llvm/lib/IR/Instructions.cpp:439: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, 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.

Now we have to figure out what the types are and what is expected. Can you go back the stack trace and add some prints to this end?

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)
jdoerfert edited the summary of this revision. (Show Details)

Rbase + include test changes

ABataev added inline comments.Aug 10 2020, 1:49 PM
clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
166–167

Looks like there is a difference in presence of the debug info

clang/test/OpenMP/parallel_codegen.cpp
80

Same, difference in presence of the debug info.

jdoerfert marked 2 inline comments as done.Aug 10 2020, 1:54 PM
jdoerfert added inline comments.
clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
166–167

The actual content of the %struct.ident_t* is the same in both versions. No difference, as described in the commit message.

jdoerfert updated this revision to Diff 284498.Aug 10 2020, 1:58 PM
jdoerfert marked an inline comment as done.

Adjust two failing tests, NFC

ABataev added inline comments.Aug 10 2020, 2:01 PM
clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
166–167

So, now, instead of locals, you generate unique global with debug info? If so, could you update at least one test with the debug info to show that the debug strings are not lost.

jdoerfert updated this revision to Diff 284501.Aug 10 2020, 2:24 PM
jdoerfert marked an inline comment as done.

Verify that the first two debug locations in
clang/test/OpenMP/threadprivate_codegen.cpp that were previously locals are
now not changed with this patch. Further verification would be start to disturb
the line numbers all over the place.

clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
166–167

Done in clang/test/OpenMP/threadprivate_codegen.cpp

This revision is now accepted and ready to land.Aug 10 2020, 2:26 PM