llvm / llvm-project

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

Compiling SVT-AV1 with -llvm -polly-parallel fails. #73209

Open R1chterScale opened 10 months ago

R1chterScale commented 10 months ago

Attempting to compile the following fork of SVT-AV1:

https://github.com/BlueSwordM/SVT-AV1

fails when polly-parallel is used. The preprocessed source and run script are attached and the stack dump is as follows:

0.  Program arguments: /usr/bin/clang -DARCH_X86_64=1 -DEN_AVX512_SUPPORT=0 -DEXCLUDE_HASH=0 -DHAVE_BUILTIN_EXPECT=1 -DHAVE_VALGRIND_H=1 -DREPRODUCIBLE_BUILDS=0 -DSAFECLIB_STR_NULL_SLACK=1 -D_FORTIFY_SOURCE=2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/. -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/API -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Common/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Common/C_DEFAULT -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/C_DEFAULT -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/third_party/fastfeat -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/../../../API -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/../../Encoder/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Globals -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSE2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSSE3 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSE4_1 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_AVX2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_AVX512 -march=native -mtune=native -Ofast -mllvm -polly -mllvm -polly-vectorizer=stripmine -mllvm -polly-num-threads=12 -mllvm -polly-ast-use-context -mllvm -polly-invariant-load-hoisting -mllvm -polly-loopfusion-greedy -mllvm -polly-run-inliner -mllvm -polly-run-dce -mllvm -polly-parallel -mllvm -polly-scheduling=static -mllvm -polly-omp-backend=LLVM -flto -O3 -DNDEBUG -std=gnu99 -fPIC -fvisibility=hidden -MD -MT Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/fft.c.o -MF CMakeFiles/ENCODER_CODEC.dir/fft.c.o.d -o CMakeFiles/ENCODER_CODEC.dir/fft.c.o -c /home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/fft.c
1.  <eof> parser at end of file
2.  Optimizer
 #0 0x00007f3e5227ef5d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/../lib/libLLVM-17.so+0xc7ef5d)
 #1 0x00007f3e5227ddb4 llvm::sys::RunSignalHandlers() (/usr/bin/../lib/libLLVM-17.so+0xc7ddb4)
 #2 0x00007f3e5219a016 (/usr/bin/../lib/libLLVM-17.so+0xb9a016)
 #3 0x00007f3e50e43580 (/usr/bin/../lib/libc.so.6+0x43580)
 #4 0x00007f3e560fe576 polly::IslNodeBuilder::createForParallel(isl_ast_node*) (/usr/bin/../lib/libLLVM-17.so+0x4afe576)
 #5 0x00007f3e561015b8 polly::IslNodeBuilder::createBlock(isl_ast_node*) (/usr/bin/../lib/libLLVM-17.so+0x4b015b8)
 #6 0x00007f3e560a6267 (/usr/bin/../lib/libLLVM-17.so+0x4aa6267)
 #7 0x00007f3e560a507e polly::CodeGenerationPass::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/bin/../lib/libLLVM-17.so+0x4aa507e)
 #8 0x00007f3e55fa5f2d (/usr/bin/../lib/libLLVM-17.so+0x49a5f2d)
 #9 0x00007f3e5609d545 llvm::PassManager<polly::Scop, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/bin/../lib/libLLVM-17.so+0x4a9d545)
#10 0x00007f3e55fadbba (/usr/bin/../lib/libLLVM-17.so+0x49adbba)
#11 0x00007f3e5245aaed llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-17.so+0xe5aaed)
#12 0x00007f3e54b32141 (/usr/bin/../lib/libLLVM-17.so+0x3532141)
#13 0x00007f3e5245f168 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-17.so+0xe5f168)
#14 0x00007f3e54b35101 (/usr/bin/../lib/libLLVM-17.so+0x3535101)
#15 0x00007f3e52458576 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-17.so+0xe58576)
#16 0x00007f3e5ba547d4 (/usr/bin/../lib/libclang-cpp.so.17+0x1e547d4)
#17 0x00007f3e5ba4b5f6 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/bin/../lib/libclang-cpp.so.17+0x1e4b5f6)
#18 0x00007f3e5be8741b (/usr/bin/../lib/libclang-cpp.so.17+0x228741b)
#19 0x00007f3e5a51c586 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.17+0x91c586)
#20 0x00007f3e5cce06ea clang::FrontendAction::Execute() (/usr/bin/../lib/libclang-cpp.so.17+0x30e06ea)
#21 0x00007f3e5cc4db40 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib/libclang-cpp.so.17+0x304db40)
#22 0x00007f3e5cd6eba0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/../lib/libclang-cpp.so.17+0x316eba0)
#23 0x0000564604c46655 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+0x11655)
#24 0x0000564604c43829 (/usr/bin/clang+0xe829)
#25 0x00007f3e5c7ab3cd (/usr/bin/../lib/libclang-cpp.so.17+0x2bab3cd)
#26 0x00007f3e5219a1e2 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/bin/../lib/libLLVM-17.so+0xb9a1e2)
#27 0x00007f3e5c7ab314 
clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/bin/../lib/libclang-cpp.so.17+0x2bab314)
#28 0x00007f3e5c766e3c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/bin/../lib/libclang-cpp.so.17+0x2b66e3c)
#29 0x00007f3e5c767087 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/bin/../lib/libclang-cpp.so.17+0x2b67087)
#30 0x00007f3e5c7a6daa clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/bin/../lib/libclang-cpp.so.17+0x2ba6daa)
#31 0x0000564604c42d30 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang+0xdd30)
#32 0x0000564604c51475 main (/usr/bin/clang+0x1c475)
#33 0x00007f3e50e27f50 (/usr/bin/../lib/libc.so.6+0x27f50)
#34 0x00007f3e50e2800a __libc_start_main (/usr/bin/../lib/libc.so.6+0x2800a)
#35 0x0000564604c3fac5 _start (/usr/bin/clang+0xaac5)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 17.0.6 (/home/r1chterscale/packages/llvm/llvm-git/llvm-project f8575ff46f89e88c3e3a7f560bb2da77206f83b7)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/fft-d2b6fb.c
clang: note: diagnostic msg: /tmp/fft-d2b6fb.sh
clang: note: diagnostic msg:

********************
make[2]: *** [Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/build.make:1056: Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/fft.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 97%] Built target ENCODER_ASM_AVX2
make[1]: *** [CMakeFiles/Makefile2:759: Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make: Leaving directory '/home/r1chterscale/.cache/yay/svt-av1-git/src/build'
==> ERROR: A failure occurred in build().
    Aborting... 

PreprocessedSourceandRunScript.zip

llvmbot commented 10 months ago

@llvm/issue-subscribers-polly

Author: None (R1chterScale)

Attempting to compile the following fork of SVT-AV1: https://github.com/BlueSwordM/SVT-AV1 fails when polly-parallel is used. The preprocessed source and run script are attached and the stack dump is as follows: ```Stack dump: 0. Program arguments: /usr/bin/clang -DARCH_X86_64=1 -DEN_AVX512_SUPPORT=0 -DEXCLUDE_HASH=0 -DHAVE_BUILTIN_EXPECT=1 -DHAVE_VALGRIND_H=1 -DREPRODUCIBLE_BUILDS=0 -DSAFECLIB_STR_NULL_SLACK=1 -D_FORTIFY_SOURCE=2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/. -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/API -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Common/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Common/C_DEFAULT -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/C_DEFAULT -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/third_party/fastfeat -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/../../../API -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/../../Encoder/Codec -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Globals -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSE2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSSE3 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_SSE4_1 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_AVX2 -I/home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/ASM_AVX512 -march=native -mtune=native -Ofast -mllvm -polly -mllvm -polly-vectorizer=stripmine -mllvm -polly-num-threads=12 -mllvm -polly-ast-use-context -mllvm -polly-invariant-load-hoisting -mllvm -polly-loopfusion-greedy -mllvm -polly-run-inliner -mllvm -polly-run-dce -mllvm -polly-parallel -mllvm -polly-scheduling=static -mllvm -polly-omp-backend=LLVM -flto -O3 -DNDEBUG -std=gnu99 -fPIC -fvisibility=hidden -MD -MT Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/fft.c.o -MF CMakeFiles/ENCODER_CODEC.dir/fft.c.o.d -o CMakeFiles/ENCODER_CODEC.dir/fft.c.o -c /home/r1chterscale/.cache/yay/svt-av1-git/src/SVT-AV1/Source/Lib/Encoder/Codec/fft.c 1. <eof> parser at end of file 2. Optimizer #0 0x00007f3e5227ef5d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/../lib/libLLVM-17.so+0xc7ef5d) #1 0x00007f3e5227ddb4 llvm::sys::RunSignalHandlers() (/usr/bin/../lib/libLLVM-17.so+0xc7ddb4) #2 0x00007f3e5219a016 (/usr/bin/../lib/libLLVM-17.so+0xb9a016) #3 0x00007f3e50e43580 (/usr/bin/../lib/libc.so.6+0x43580) #4 0x00007f3e560fe576 polly::IslNodeBuilder::createForParallel(isl_ast_node*) (/usr/bin/../lib/libLLVM-17.so+0x4afe576) #5 0x00007f3e561015b8 polly::IslNodeBuilder::createBlock(isl_ast_node*) (/usr/bin/../lib/libLLVM-17.so+0x4b015b8) #6 0x00007f3e560a6267 (/usr/bin/../lib/libLLVM-17.so+0x4aa6267) #7 0x00007f3e560a507e polly::CodeGenerationPass::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/bin/../lib/libLLVM-17.so+0x4aa507e) #8 0x00007f3e55fa5f2d (/usr/bin/../lib/libLLVM-17.so+0x49a5f2d) #9 0x00007f3e5609d545 llvm::PassManager<polly::Scop, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/bin/../lib/libLLVM-17.so+0x4a9d545) #10 0x00007f3e55fadbba (/usr/bin/../lib/libLLVM-17.so+0x49adbba) #11 0x00007f3e5245aaed llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-17.so+0xe5aaed) #12 0x00007f3e54b32141 (/usr/bin/../lib/libLLVM-17.so+0x3532141) #13 0x00007f3e5245f168 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-17.so+0xe5f168) #14 0x00007f3e54b35101 (/usr/bin/../lib/libLLVM-17.so+0x3535101) #15 0x00007f3e52458576 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-17.so+0xe58576) #16 0x00007f3e5ba547d4 (/usr/bin/../lib/libclang-cpp.so.17+0x1e547d4) #17 0x00007f3e5ba4b5f6 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/bin/../lib/libclang-cpp.so.17+0x1e4b5f6) #18 0x00007f3e5be8741b (/usr/bin/../lib/libclang-cpp.so.17+0x228741b) #19 0x00007f3e5a51c586 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.17+0x91c586) #20 0x00007f3e5cce06ea clang::FrontendAction::Execute() (/usr/bin/../lib/libclang-cpp.so.17+0x30e06ea) #21 0x00007f3e5cc4db40 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib/libclang-cpp.so.17+0x304db40) #22 0x00007f3e5cd6eba0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/../lib/libclang-cpp.so.17+0x316eba0) #23 0x0000564604c46655 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+0x11655) #24 0x0000564604c43829 (/usr/bin/clang+0xe829) #25 0x00007f3e5c7ab3cd (/usr/bin/../lib/libclang-cpp.so.17+0x2bab3cd) #26 0x00007f3e5219a1e2 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/bin/../lib/libLLVM-17.so+0xb9a1e2) #27 0x00007f3e5c7ab314 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/bin/../lib/libclang-cpp.so.17+0x2bab314) #28 0x00007f3e5c766e3c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/bin/../lib/libclang-cpp.so.17+0x2b66e3c) #29 0x00007f3e5c767087 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/bin/../lib/libclang-cpp.so.17+0x2b67087) #30 0x00007f3e5c7a6daa clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/bin/../lib/libclang-cpp.so.17+0x2ba6daa) #31 0x0000564604c42d30 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang+0xdd30) #32 0x0000564604c51475 main (/usr/bin/clang+0x1c475) #33 0x00007f3e50e27f50 (/usr/bin/../lib/libc.so.6+0x27f50) #34 0x00007f3e50e2800a __libc_start_main (/usr/bin/../lib/libc.so.6+0x2800a) #35 0x0000564604c3fac5 _start (/usr/bin/clang+0xaac5) clang: error: clang frontend command failed with exit code 139 (use -v to see invocation) clang version 17.0.6 (/home/r1chterscale/packages/llvm/llvm-git/llvm-project f8575ff46f89e88c3e3a7f560bb2da77206f83b7) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/fft-d2b6fb.c clang: note: diagnostic msg: /tmp/fft-d2b6fb.sh clang: note: diagnostic msg: ******************** make[2]: *** [Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/build.make:1056: Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/fft.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... [ 97%] Built target ENCODER_ASM_AVX2 make[1]: *** [CMakeFiles/Makefile2:759: Source/Lib/Encoder/Codec/CMakeFiles/ENCODER_CODEC.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 make: Leaving directory '/home/r1chterscale/.cache/yay/svt-av1-git/src/build' ==> ERROR: A failure occurred in build(). Aborting... ``` [PreprocessedSourceandRunScript.zip](https://github.com/llvm/llvm-project/files/13445997/PreprocessedSourceandRunScript.zip)
R1chterScale commented 10 months ago

It appears to fail on AOM-AV1 as well, on the fast fourier transform file (fft.c), seems to be shared between the two programs