llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.84k stars 11.47k forks source link

[flang] [OpenMP] Assertion `Outputs.empty() && "OpenMP outlining should not produce live-out values!"' failed. #67231

Open k-arrows opened 11 months ago

k-arrows commented 11 months ago

Reproducer: https://github.com/gcc-mirror/gcc/blob/master/libgomp/testsuite/libgomp.fortran/target8.f90

Stack dump:

 #0 0x000055d7c2d38533 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x000055d7c2d38bae SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fb9958dc520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007fb995930a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #4 0x00007fb995930a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #5 0x00007fb995930a7c pthread_kill ./nptl/pthread_kill.c:89:10
 #6 0x00007fb9958dc476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #7 0x00007fb9958c27f3 abort ./stdlib/abort.c:81:7
 #8 0x00007fb9958c271b _nl_load_domain ./intl/loadmsgcat.c:1177:9
 #9 0x00007fb9958d3e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#10 0x000055d7c4ee29a1 
#11 0x000055d7c3b607ab (anonymous namespace)::OpenMPDialectLLVMIRTranslationInterface::convertOperation(mlir::Operation*, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) const OpenMPToLLVMIRTranslation.cpp:0:0
#12 0x000055d7c42e5d66 mlir::LLVM::ModuleTranslation::convertOperation(mlir::Operation&, llvm::IRBuilderBase&) 
#13 0x000055d7c42e6056 mlir::LLVM::ModuleTranslation::convertBlock(mlir::Block&, bool, llvm::IRBuilderBase&) 
#14 0x000055d7c42e73b5 mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) 
#15 0x000055d7c42e8634 mlir::LLVM::ModuleTranslation::convertFunctions() 
#16 0x000055d7c42e9a06 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef) 
#17 0x000055d7c2e8b07c Fortran::frontend::CodeGenAction::generateLLVMIR() 
#18 0x000055d7c2e8c4a4 Fortran::frontend::CodeGenAction::executeAction() 
#19 0x000055d7c2d5ae34 Fortran::frontend::FrontendAction::execute() 
#20 0x000055d7c2d5229d Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) 
#21 0x000055d7c2d5dc94 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) 
#22 0x000055d7c1d35188 fc1_main(llvm::ArrayRef<char const*>, char const*) 
#23 0x000055d7c1d34176 main 
#24 0x00007fb9958c3d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#25 0x00007fb9958c3e40 call_init ./csu/../csu/libc-start.c:128:20
#26 0x00007fb9958c3e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#27 0x000055d7c1d336d5 _start 
flang-new: error: unable to execute command: Aborted
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 18.0.0 (https://github.com/llvm/llvm-project.git d230bf3fce6d7fb1d0a1c5ec10b3d2101adb11d6)
Target: x86_64-unknown-linux-gnu
Thread model: posix

When I tested this program in August, I got the following TODO message:

not yet implemented: OMPD_target_data for Array Expressions or Structure Components
llvmbot commented 11 months ago

@llvm/issue-subscribers-flang-ir

Reproducer: https://github.com/gcc-mirror/gcc/blob/master/libgomp/testsuite/libgomp.fortran/target8.f90 Stack dump: ```console #0 0x000055d7c2d38533 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) #1 0x000055d7c2d38bae SignalHandler(int) Signals.cpp:0:0 #2 0x00007fb9958dc520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #3 0x00007fb995930a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76 #4 0x00007fb995930a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10 #5 0x00007fb995930a7c pthread_kill ./nptl/pthread_kill.c:89:10 #6 0x00007fb9958dc476 gsignal ./signal/../sysdeps/posix/raise.c:27:6 #7 0x00007fb9958c27f3 abort ./stdlib/abort.c:81:7 #8 0x00007fb9958c271b _nl_load_domain ./intl/loadmsgcat.c:1177:9 #9 0x00007fb9958d3e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #10 0x000055d7c4ee29a1 #11 0x000055d7c3b607ab (anonymous namespace)::OpenMPDialectLLVMIRTranslationInterface::convertOperation(mlir::Operation*, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) const OpenMPToLLVMIRTranslation.cpp:0:0 #12 0x000055d7c42e5d66 mlir::LLVM::ModuleTranslation::convertOperation(mlir::Operation&, llvm::IRBuilderBase&) #13 0x000055d7c42e6056 mlir::LLVM::ModuleTranslation::convertBlock(mlir::Block&, bool, llvm::IRBuilderBase&) #14 0x000055d7c42e73b5 mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) #15 0x000055d7c42e8634 mlir::LLVM::ModuleTranslation::convertFunctions() #16 0x000055d7c42e9a06 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef) #17 0x000055d7c2e8b07c Fortran::frontend::CodeGenAction::generateLLVMIR() #18 0x000055d7c2e8c4a4 Fortran::frontend::CodeGenAction::executeAction() #19 0x000055d7c2d5ae34 Fortran::frontend::FrontendAction::execute() #20 0x000055d7c2d5229d Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) #21 0x000055d7c2d5dc94 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) #22 0x000055d7c1d35188 fc1_main(llvm::ArrayRef<char const*>, char const*) #23 0x000055d7c1d34176 main #24 0x00007fb9958c3d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #25 0x00007fb9958c3e40 call_init ./csu/../csu/libc-start.c:128:20 #26 0x00007fb9958c3e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 #27 0x000055d7c1d336d5 _start flang-new: error: unable to execute command: Aborted flang-new: error: flang frontend command failed due to signal (use -v to see invocation) flang-new version 18.0.0 (https://github.com/llvm/llvm-project.git d230bf3fce6d7fb1d0a1c5ec10b3d2101adb11d6) Target: x86_64-unknown-linux-gnu Thread model: posix ``` When I tested this program in August, I got the following TODO message: ```txt not yet implemented: OMPD_target_data for Array Expressions or Structure Components ```
llvmbot commented 11 months ago

@llvm/issue-subscribers-openmp

Reproducer: https://github.com/gcc-mirror/gcc/blob/master/libgomp/testsuite/libgomp.fortran/target8.f90 Stack dump: ```console #0 0x000055d7c2d38533 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) #1 0x000055d7c2d38bae SignalHandler(int) Signals.cpp:0:0 #2 0x00007fb9958dc520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #3 0x00007fb995930a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76 #4 0x00007fb995930a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10 #5 0x00007fb995930a7c pthread_kill ./nptl/pthread_kill.c:89:10 #6 0x00007fb9958dc476 gsignal ./signal/../sysdeps/posix/raise.c:27:6 #7 0x00007fb9958c27f3 abort ./stdlib/abort.c:81:7 #8 0x00007fb9958c271b _nl_load_domain ./intl/loadmsgcat.c:1177:9 #9 0x00007fb9958d3e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #10 0x000055d7c4ee29a1 #11 0x000055d7c3b607ab (anonymous namespace)::OpenMPDialectLLVMIRTranslationInterface::convertOperation(mlir::Operation*, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) const OpenMPToLLVMIRTranslation.cpp:0:0 #12 0x000055d7c42e5d66 mlir::LLVM::ModuleTranslation::convertOperation(mlir::Operation&, llvm::IRBuilderBase&) #13 0x000055d7c42e6056 mlir::LLVM::ModuleTranslation::convertBlock(mlir::Block&, bool, llvm::IRBuilderBase&) #14 0x000055d7c42e73b5 mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) #15 0x000055d7c42e8634 mlir::LLVM::ModuleTranslation::convertFunctions() #16 0x000055d7c42e9a06 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef) #17 0x000055d7c2e8b07c Fortran::frontend::CodeGenAction::generateLLVMIR() #18 0x000055d7c2e8c4a4 Fortran::frontend::CodeGenAction::executeAction() #19 0x000055d7c2d5ae34 Fortran::frontend::FrontendAction::execute() #20 0x000055d7c2d5229d Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) #21 0x000055d7c2d5dc94 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) #22 0x000055d7c1d35188 fc1_main(llvm::ArrayRef<char const*>, char const*) #23 0x000055d7c1d34176 main #24 0x00007fb9958c3d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #25 0x00007fb9958c3e40 call_init ./csu/../csu/libc-start.c:128:20 #26 0x00007fb9958c3e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 #27 0x000055d7c1d336d5 _start flang-new: error: unable to execute command: Aborted flang-new: error: flang frontend command failed due to signal (use -v to see invocation) flang-new version 18.0.0 (https://github.com/llvm/llvm-project.git d230bf3fce6d7fb1d0a1c5ec10b3d2101adb11d6) Target: x86_64-unknown-linux-gnu Thread model: posix ``` When I tested this program in August, I got the following TODO message: ```txt not yet implemented: OMPD_target_data for Array Expressions or Structure Components ```
kiranchandramohan commented 11 months ago

@agozillon : Could you have a look?

agozillon commented 2 months ago

Had a bit of a look while trying to resolve the issue with the other incredibly similar example which I progressed to the point of having the same error.

I believe it's likely related to the multiple directive nestings not quite working as they should (I don't think we've progressed to the point of dealing with this level of nesting yet) rather than anything specific to map or declare target, we've just progressed past the point of the original TODO being a valid reason for the test to not progress further.

It's now on my TODO list and I talked a small amount more about it in the other issue, but I have a feeling we will encounter this issue eventually and deal with it, but I think we may be a bit away from supporting this level of nesting (maybe closer than I expect, I am not particularly well versed in the other directives in use and there current state without doing more of an in-depth look).