llvm / llvm-project

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

polly crashes with "opt -polly-dependences -polly-scops -polly-codegen -polly-ast": running pass 'Polly - Generate an AST from the SCoP (isl)' #33782

Open zhendongsu opened 7 years ago

zhendongsu commented 7 years ago
Bugzilla Link 34434
Version unspecified
OS All
CC @tobiasgrosser

Extended Description

I'm not sure whether this is a bug of interest, but here it is.

$ clangpolly -v clang version 6.0.0 (http://llvm.org/git/clang.git 48231c128c697271508e83b487d436a071e62f09) (http://llvm.org/git/llvm.git aedd47f9e210dc3ce82a1f885043d7d005b52dd7) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/su/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Candidate multilib: x32;@mx32 Selected multilib: .;@m64 $ $ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c $ optpolly -polly-dependences -polly-scops -polly-codegen -polly-ast -o small-opt.bc small.bc optpolly: /home/su/software/tmp/polly/llvm/include/llvm/PassAnalysisSupport.h:236: AnalysisType& llvm::Pass::getAnalysisID(llvm::AnalysisID) const [with AnalysisType = polly::ScopInfoRegionPass; llvm::AnalysisID = const void]: Assertion `ResultPass && "getAnalysis() called on an analysis that was not " "'required' by pass!"' failed.

​0 0x00000000038af852 (optpolly+0x38af852)

​1 0x00000000038af8e3 (optpolly+0x38af8e3)

​2 0x00000000038adcf8 (optpolly+0x38adcf8)

​3 0x00000000038af1d5 (optpolly+0x38af1d5)

​4 0x00007ff6e8af0330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)

​5 0x00007ff6e78d8c37 gsignal /build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0

​6 0x00007ff6e78dc028 abort /build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0

​7 0x00007ff6e78d1bf6 __assert_fail_base /build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0

​8 0x00007ff6e78d1ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)

​9 0x0000000003c7c92d (optpolly+0x3c7c92d)

​10 0x0000000003c7c25e (optpolly+0x3c7c25e)

​11 0x0000000003c7b2e8 (optpolly+0x3c7b2e8)

​12 0x0000000002ac4c8f (optpolly+0x2ac4c8f)

​13 0x0000000003193724 (optpolly+0x3193724)

​14 0x00000000031938b7 (optpolly+0x31938b7)

​15 0x0000000003193c52 (optpolly+0x3193c52)

​16 0x00000000031943a9 (optpolly+0x31943a9)

​17 0x00000000031945e9 (optpolly+0x31945e9)

​18 0x00000000017fe118 (optpolly+0x17fe118)

​19 0x00007ff6e78c3f45 __libc_start_main /build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0

​20 0x00000000017d7a29 (optpolly+0x17d7a29)

Stack dump:

  1. Program arguments: optpolly -polly-dependences -polly-scops -polly-codegen -polly-ast -o small-opt.bc small.bc
  2. Running pass 'Function Pass Manager' on module 'small.bc'.
  3. Running pass 'Region Pass Manager' on function '@main'
  4. Running pass 'Polly - Generate an AST from the SCoP (isl)' on basic block '%entry' Aborted (core dumped) $

int main () { return 0; }

tobiasgrosser commented 7 years ago

Interesting. This likely should not crash. However, it is a pass order we do not use and consequently should not arise in practice.

Our pass system should become a lot cleaner with the new pass manager.