[LLVMdev] mblaze backend: unreachable executed

Josef Spjut sjosef at cs.utah.edu
Tue Mar 15 11:27:39 PDT 2011


Hello,

I am working on a backend for a custom ISA that is somewhat similar to the MicroBlaze ISA so I've decided to use that as a starting point. I am trying to compile a custom ray tracer (lots of floating point) and the llvm-g++ frontend generates an fneg instruction which is not supported by the MBlaze backend in the 2.8 release. I added code to emit an fneg assembly instruction and now I'm getting "UNREACHABLE executed!" when trying to compile the code. The only change I made was to add the following two lines next to the square root lines in the code (FPU and sqrt are enabled in llc):

  def FSQRT  : ArithF2<0x16, 0x300, "fsqrt  ", IIAlu>;
  def FNEG   : ArithF2<0x16, 0x300, "fneg   ", IIAlu>; // added for fneg

and

  def : Pat<(fsqrt FGR32:$V), (FSQRT FGR32:$V)>;
  def : Pat<(fneg FGR32:$V), (FNEG FGR32:$V)>; // added for fneg

Does anyone know what common causes of "UNREACHABLE executed!" messages are and what this message in particular means? The full error message is the following:

UNREACHABLE executed!
0  llc               0x0000000100936ae2 PrintStackTrace(void*) + 34
1  llc               0x0000000100937603 SignalHandler(int) + 531
2  libSystem.B.dylib 0x00007fff82adf67a _sigtramp + 26
3  libSystem.B.dylib 000000000000000000 _sigtramp + 2102528416
4  llc               0x0000000100936aa6 abort + 22
5  llc               0x000000010091551d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 381
6  llc               0x000000010058100e llvm::CCState::AnalyzeCallResult(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::EVT, llvm::EVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) + 158
7  llc               0x000000010007319c llvm::TraxTargetLowering::LowerCallResult(llvm::SDValue, llvm::SDValue, llvm::CallingConv::ID, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const + 172
8  llc               0x0000000100075353 llvm::TraxTargetLowering::LowerCall(llvm::SDValue, llvm::SDValue, llvm::CallingConv::ID, bool, bool&, llvm::SmallVectorImpl<llvm::ISD::OutputArg> const&, llvm::SmallVectorImpl<llvm::SDValue> const&, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const + 4179
9  llc               0x00000001004c3dcd llvm::TargetLowering::LowerCallTo(llvm::SDValue, llvm::Type const*, bool, bool, bool, bool, unsigned int, llvm::CallingConv::ID, bool, bool, llvm::SDValue, std::vector<llvm::TargetLowering::ArgListEntry, std::allocator<llvm::TargetLowering::ArgListEntry> >&, llvm::SelectionDAG&, llvm::DebugLoc) const + 4269
10 llc               0x00000001004d1c0b llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2363
11 llc               0x00000001004e6dc9 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 185
12 llc               0x00000001004c8828 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 600
13 llc               0x00000001004fdef3 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 51
14 llc               0x000000010050a558 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 56
15 llc               0x000000010050abe2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1506
16 llc               0x000000010050b4a8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 392
17 llc               0x00000001005d4cbd llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 125
18 llc               0x00000001008809b0 llvm::FPPassManager::runOnFunction(llvm::Function&) + 656
19 llc               0x0000000100880a6b llvm::FPPassManager::runOnModule(llvm::Module&) + 139
20 llc               0x0000000100882122 llvm::MPPassManager::runOnModule(llvm::Module&) + 562
21 llc               0x0000000100882423 llvm::PassManagerImpl::run(llvm::Module&) + 243
22 llc               0x00000001008824bd llvm::PassManager::run(llvm::Module&) + 13
23 llc               0x0000000100023c8a main + 3754
24 llc               0x0000000100022848 start + 52
Stack dump:
0.	Program arguments: ./Release/bin/llc rt-rot.bc -o rt-rot.s -march=trax 
1.	Running pass 'Function Pass Manager' on module 'rt-rot.bc'.
2.	Running pass 'Trax DAG->DAG Pattern Instruction Selection' on function '@main'

Note that Trax is the name of my custom back end and the only changes other than the ones above are changing the names to Trax from MBlaze.

Thanks for any help.

Josef Spjut





More information about the llvm-dev mailing list