Open llvmbot opened 10 years ago
It is reproducible with "clang -O0 -emit-llvm -S | opt -O1"
...and it is not infinite loop. I hit LICM at first.
===-------------------------------------------------------------------------=== ... Pass execution timing report ... ===-------------------------------------------------------------------------=== Total Execution Time: 2516.2075 seconds (2516.6312 wall clock)
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- 685.5958 ( 27.2%) 0.0000 ( 0.0%) 685.5958 ( 27.2%) 685.7107 ( 27.2%) Delete dead loops 454.4459 ( 18.1%) 0.0000 ( 0.0%) 454.4459 ( 18.1%) 454.5218 ( 18.1%) Block Frequency Analysis 349.6658 ( 13.9%) 0.0000 ( 0.0%) 349.6658 ( 13.9%) 349.7282 ( 13.9%) Loop Invariant Code Motion 345.2845 ( 13.7%) 0.0000 ( 0.0%) 345.2845 ( 13.7%) 345.3420 ( 13.7%) Unswitch loops 340.6992 ( 13.5%) 0.0000 ( 0.0%) 340.6992 ( 13.5%) 340.7560 ( 13.5%) Loop Vectorization 340.0083 ( 13.5%) 0.0000 ( 0.0%) 340.0083 ( 13.5%) 340.0651 ( 13.5%) Induction Variable Simplification (snip)
Here's a backtrace. It seems we're stuck in the loop in Loop::hasDedicatedExits().
at /usr/local/google/work/llvm/include/llvm/Support/CFG.h:52
at /usr/local/google/work/llvm/include/llvm/Support/CFG.h:53
at /usr/local/google/work/llvm/lib/Analysis/LoopInfo.cpp:341
this=0x653b3c0, L=0x63eb410, LPM=...)
at /usr/local/google/work/llvm/lib/Transforms/Scalar/LICM.cpp:281
F=...) at /usr/local/google/work/llvm/lib/Analysis/LoopPass.cpp:232
F=...) at /usr/local/google/work/llvm/lib/IR/LegacyPassManager.cpp:1537
this=0x6532ad0, P=0x6534a60, CurSCC=..., CG=...,
CallGraphUpToDate=@0x7fffffffbb0f: true,
DevirtualizedCall=@0x7fffffffbc1f: false)
at /usr/local/google/work/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:148
DevirtualizedCall=@0x7fffffffbc1f: false)
at /usr/local/google/work/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:405
this=0x6532ad0, M=...)
at /usr/local/google/work/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:460
this=0x652c170, M=...)
at /usr/local/google/work/llvm/lib/IR/LegacyPassManager.cpp:1615
M=...) at /usr/local/google/work/llvm/lib/IR/LegacyPassManager.cpp:1710
M=...) at /usr/local/google/work/llvm/lib/IR/LegacyPassManager.cpp:1745
at /usr/local/google/work/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:599
TOpts=..., LOpts=..., TDesc=..., M=0x591f3d0,
Action=clang::Backend_EmitObj, OS=0x5917b00)
Extended Description
This hangs infinitely:
$ clang++ -O1 utf16_group_C.w.cpp
This .cpp file is autogenerated by RE2C scanner generator. RE2C can generate either 'switch' statements or nested 'if' statements that express the same logic. Clang hangs on 'switch'es, but doesn't hang on 'if's. Clang hangs with -O1 or higher level of optimisations, but not with -O0.