llvm / llvm-project

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

Polly in trunk r231583: Assertion failed: (Stmt.isBlockStmt() && "TODO: Only block statements can be copied by " "the vector block generator"), function copyStmt, file CodeGen/BlockGenerators.cpp, line 651. #23237

Closed 0e6f8740-1d2a-4afc-85fd-df25c3a603fd closed 2 years ago

0e6f8740-1d2a-4afc-85fd-df25c3a603fd commented 9 years ago
Bugzilla Link 22863
Resolution FIXED
Resolved on Jan 18, 2016 17:02
Version unspecified
OS All
Attachments avf_showcqt-b82350.sh, avf_showcqt-b82350.c.bz2
CC @jdoerfert,@tobiasgrosser

Extended Description

Polly fails to build ffmpeg in recent llvm trunk

Assertion failed: (Stmt.isBlockStmt() && "TODO: Only block statements can be copied by " "the vector block generator"), function copyStmt, file CodeGen/BlockGenerators.cpp, line 651. 0 libLLVM-3.7svn.dylib 0x0000000108947704 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 57 1 libLLVM-3.7svn.dylib 0x0000000108947d52 SignalHandler(int) + 220 2 libsystem_c.dylib 0x00007fff9121b90a _sigtramp + 26 3 libsystem_c.dylib 0x00007fa91845fa28 _sigtramp + 2267300152 4 libLLVM-3.7svn.dylib 0x0000000108947bd5 abort + 22 5 libLLVM-3.7svn.dylib 0x0000000108947bbf abort + 0 6 LLVMPolly.dylib 0x000000010a420e74 polly::RegionGenerator::repairDominance(llvm::BasicBlock, llvm::BasicBlock, llvm::DenseMap<llvm::BasicBlock, llvm::BasicBlock, llvm::DenseMapInfo<llvm::BasicBlock>, llvm::detail::DenseMapPair<llvm::BasicBlock, llvm::BasicBlock> >&) + 0 7 LLVMPolly.dylib 0x000000010a428810 IslNodeBuilder::createUserVector(isl_ast_node, std::1::vector<llvm::Value*, std::1::allocator<llvm::Value> >&, isl_id, isl_union_map) + 328 8 LLVMPolly.dylib 0x000000010a428c4d IslNodeBuilder::createForVector(isl_ast_node, int) + 787 9 LLVMPolly.dylib 0x000000010a428ff3 IslNodeBuilder::createForSequential(isl_ast_node) + 759 10 LLVMPolly.dylib 0x000000010a42a265 IslNodeBuilder::createBlock(isl_ast_node) + 63 11 LLVMPolly.dylib 0x000000010a42aba4 (anonymous namespace)::IslCodeGeneration::runOnScop(polly::Scop&) + 528 12 LLVMPolly.dylib 0x000000010a419119 polly::ScopPass::runOnRegion(llvm::Region, llvm::RGPassManager&) + 47 13 libLLVM-3.7svn.dylib 0x0000000107f0b473 llvm::RGPassManager::runOnFunction(llvm::Function&) + 749 14 libLLVM-3.7svn.dylib 0x0000000108257175 llvm::FPPassManager::runOnFunction(llvm::Function&) + 297 15 libLLVM-3.7svn.dylib 0x0000000108256c6d llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 91 16 libLLVM-3.7svn.dylib 0x0000000108256ba2 llvm::legacy::FunctionPassManager::run(llvm::Function&) + 48 17 clang 0x000000010644600c clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module, clang::BackendAction, llvm::raw_ostream) + 6326 18 clang 0x0000000106542689 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 527 19 clang 0x00000001065b6b39 clang::ParseAST(clang::Sema&, bool, bool) + 384 20 clang 0x000000010654181b clang::CodeGenAction::ExecuteAction() + 519 21 clang 0x00000001063069d1 clang::FrontendAction::Execute() + 67 22 clang 0x00000001062e106b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 547 23 clang 0x00000001062b1587 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 3931 24 clang 0x00000001062a9cdc cc1_main(llvm::ArrayRef<char const>, char const, void*) + 940 25 clang 0x00000001062af8e2 main + 8117 26 libdyld.dylib 0x00007fff912177e1 start + 0 27 libdyld.dylib 0x000000000000006f start + 1860077710 Stack dump:

  1. Program arguments: /opt/local/libexec/llvm-3.7/bin/clang -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -disable-free -main-file-name avf_showcqt.c -mrelocation-model pic -pic-level 2 -mthread-model posix -fno-signed-zeros -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -gdwarf-2 -dwarf-column-info -coverage-file /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-polly-vectorize-3.7/build/libavfilter/avf_showcqt.o -resource-dir /opt/local/libexec/llvm-3.7/bin/../lib/clang/3.7.0 -dependency-file libavfilter/avf_showcqt.d -MT libavfilter/avf_showcqt.o -D _ISOC99_SOURCE -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D PIC -D ZLIB_CONST -D HAVE_AV_CONFIG_H -D _GNU_SOURCE=1 -D _THREAD_SAFE -I . -I /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-polly-vectorize-3.7/src/ -I /opt/local/include/SDL -I /opt/local/include -I /opt/local/include -I /opt/local/include -I /opt/local/include -O3 -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -std=c99 -fconst-strings -fdebug-compilation-dir /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-polly-vectorize-3.7/build -ferror-limit 19 -fmessage-length 0 -pthread -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -vectorize-loops -vectorize-slp -load /opt/local/libexec/llvm-3.7/lib/LLVMPolly.dylib -mllvm -polly -mllvm -polly-vectorizer=polly -o libavfilter/avf_showcqt.o -x c /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-polly-vectorize-3.7/src/libavfilter/avf_showcqt.c
  2. parser at end of file
  3. Per-function optimization
  4. Running pass 'Region Pass Manager' on function '@plot_cqt'
  5. Running pass 'Polly - Create LLVM-IR from SCoPs' on basic block '%for.body421' clang: error: unable to execute command: Illegal instruction: 4 clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.7.0 (trunk 231583) Target: x86_64-apple-darwin12.5.0 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. 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: /var/folders/yk/q1qsnnm53ms89plrqm9yrqc00000gn/T/avf_showcqt-b82350.c clang: note: diagnostic msg: /var/folders/yk/q1qsnnm53ms89plrqm9yrqc00000gn/T/avf_showcqt-b82350.sh clang: note: diagnostic msg:


make: *** [libavfilter/avf_showcqt.o] Error 254

tobiasgrosser commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#23127

tlattner commented 8 years ago

Move to Polly Product.

tobiasgrosser commented 9 years ago

This works for me with r250518.

tobiasgrosser commented 9 years ago

Bug llvm/llvm-bugzilla-archive#23127 has been marked as a duplicate of this bug.

jdoerfert commented 9 years ago

The TODO in the assertion is supposed to tell people that polly vector code generation is not compatible with non-affine subregions yet. The latter is by default on, the former is not, thus with -polly -O3 this should not happen.

In case the polly vectorizer is requested specifically with -polly-vectorizer=polly (as is the case here) the non-affine subregion detection has to be disabled: -polly-allow-nonaffine-branches=false

I would suggest you close this bug and open a "ticket" to implement non-affine subregion support in the vector code generator.

tobiasgrosser commented 9 years ago

This assert was introduced by commit:

commit 195f94f406dd53a34bc8138e41d3ce3c3c454d94 Author: Johannes Doerfert doerfert@cs.uni-saarland.de Date: Tue Feb 24 16:16:32 2015 +0000

Allow non-affine control flow -- Code Generation

  This is the code generation for region statements that are created
  when non-affine control flow was present in the input. A new
  generator, similar to the block or vector generator, for regions is
  used to traverse and copy the region statement and to adjust the
  control flow inside the new region in the end.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@230340