[llvm-dev] Fwd: bugpoint can't automatically select a safe interpreter!

Jay Foad via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 22 02:33:58 PDT 2019


I tried to reduce the test case in
https://bugs.llvm.org/show_bug.cgi?id=42706. Here it is crashing opt:

$ ~/llvm-debug/bin/opt -use-gpu-divergence-analysis -divergence stripped.ll
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt: /home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:312:
std::unique_ptr<ConstBlockSet>
llvm::DivergencePropagator::computeJoinPoints(const llvm::BasicBlock
&, SuccessorIterable, const llvm::Loop *, const llvm::BasicBlock *)
[SuccessorIterable = llvm::iterator_range<llvm::SuccIterator<const
llvm::Instruction, const llvm::BasicBlock> >]: Assertion
`HeaderDefBlock && "no definition in header of carrying loop"' failed.
Stack dump:
0. Program arguments: /home/jayfoad2/llvm-debug/bin/opt
-use-gpu-divergence-analysis -divergence stripped.ll
1. Running pass 'Function Pass Manager' on module 'stripped.ll'.
2. Running pass 'Legacy Divergence Analysis' on function '@llpc.shader.CS.main'
 #0 0x0000000005fa0889 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:533:11
 #1 0x0000000005fa0a39 PrintStackTraceSignalHandler(void*)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:594:1
 #2 0x0000000005f9f276 llvm::sys::RunSignalHandlers()
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000005fa112b SignalHandler(int)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:385:1
 #4 0x00007f56aeff0890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007f56adcb6e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f56adcb8801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f56adca839a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007f56adca8412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x0000000004e3db75
std::unique_ptr<llvm::SmallPtrSet<llvm::BasicBlock const*, 4u>,
std::default_delete<llvm::SmallPtrSet<llvm::BasicBlock const*, 4u> > >
llvm::DivergencePropagator::computeJoinPoints<llvm::iterator_range<llvm::SuccIterator<llvm::Instruction
const, llvm::BasicBlock const> > >(llvm::BasicBlock const&,
llvm::iterator_range<llvm::SuccIterator<llvm::Instruction const,
llvm::BasicBlock const> >, llvm::Loop const*, llvm::BasicBlock const*)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:0:7
#10 0x0000000004e3c5e4
llvm::SyncDependenceAnalysis::join_blocks(llvm::Instruction const&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:381:32
#11 0x0000000004c1abf3
llvm::DivergenceAnalysis::propagateBranchDivergence(llvm::Instruction
const&) /home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:311:36
#12 0x0000000004c1b106 llvm::DivergenceAnalysis::compute()
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:386:9
#13 0x0000000004c1b54b
llvm::GPUDivergenceAnalysis::GPUDivergenceAnalysis(llvm::Function&,
llvm::DominatorTree const&, llvm::PostDominatorTree const&,
llvm::LoopInfo const&, llvm::TargetTransformInfo const&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:446:1
#14 0x0000000004c162c5
std::enable_if<!(std::is_array<llvm::GPUDivergenceAnalysis>::value),
std::unique_ptr<llvm::GPUDivergenceAnalysis,
std::default_delete<llvm::GPUDivergenceAnalysis> > >::type
llvm::make_unique<llvm::GPUDivergenceAnalysis, llvm::Function&,
llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo&>(llvm::Function&, llvm::DominatorTree&,
llvm::PostDominatorTree&, llvm::LoopInfo&, llvm::TargetTransformInfo&)
/home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1406:10
#15 0x0000000004c14b15
llvm::LegacyDivergenceAnalysis::runOnFunction(llvm::Function&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp:331:13
#16 0x00000000055c114c
llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1648:23
#17 0x00000000055c15a2 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1685:16
#18 0x00000000055c1d34 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1750:23
#19 0x00000000055c1848
llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1863:16
#20 0x00000000055c22c1 llvm::legacy::PassManager::run(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1894:3
#21 0x0000000003209671 main
/home/jayfoad2/git/llvm-project/llvm/tools/opt/opt.cpp:893:3
#22 0x00007f56adc99b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#23 0x00000000031c502a _start (/home/jayfoad2/llvm-debug/bin/opt+0x31c502a)
Aborted (core dumped)

But if I try the same thing with bugpoint I get:

$ ~/llvm-debug/bin/bugpoint -use-gpu-divergence-analysis -divergence stripped.ll
Read input file      : 'stripped.ll'
*** All input ok
Running selected passes on program to test for crash: Success!
Initializing execution environment: Found lli: /home/jayfoad2/llvm-debug/bin/lli
Sorry, I can't automatically select a safe interpreter!

Exiting.

What does this mean? What is a "safe interpreter", and why does
bugpoint think it needs one in order to try to reduce the test case?

The documentation for bugpoint suggests that it will only try to use a
"safe backend" if none of the passes specified on the command line
crash.

Jay.


More information about the llvm-dev mailing list