Unreachable Executed error.


I’ve written a pass that basically does some code transformations to enable parallel execution. After the transformation llvm runs BitCode Writer pass , which is aborting with Unreachable Executed error. What does this error generally mean?.
Any pointers on how to go about debugging this.


Run the verifier pass after your pass. The bitcode readers and
writers assume that the IR is well-formed, which yours may not be.


The verifier pass is running after my pass completes. If the transformed code is not well-formed the module should break ideally, but it is not throwing an error during that pass. I can paste the stack dump if that helps.

0 opt 0x000000000076cadf
1 opt 0x000000000076d118
2 libpthread.so.0 0x00007f1c51a6bef0
3 libc.so.6 0x00007f1c50b83665 gsignal + 53
4 libc.so.6 0x00007f1c50b84b83 abort + 387
5 opt 0x0000000000755dd8 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 344
6 opt 0x0000000000682f32
7 opt 0x0000000000684a8b
8 opt 0x0000000000686867
9 opt 0x0000000000686d1d llvm::WriteBitcodeToFile(llvm::Module const*, llvm::raw_ostream&) + 221
10 opt 0x000000000067f2fc
11 opt 0x000000000070cb45 llvm::MPPassManager::runOnModule(llvm::Module&) + 453
12 opt 0x000000000070cdb9 llvm::PassManagerImpl::run(llvm::Module&) + 105
13 opt 0x000000000048d6c1 main + 1313
14 libc.so.6 0x00007f1c50b6fa26 __libc_start_main + 230
15 opt 0x0000000000483a79
Stack dump:
0. Running pass ‘Bitcode Writer’ on module ‘’.