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
Hello> 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:Looks like you have not implemented the calling convention bits for your backend. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Hello, Am 15.03.2011 um 19:27 schrieb Josef Spjut:> 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'Running the Debug+Asserts version instead of the Release should give you the file and line of the "unreachable" code. Andreas
On Mar 15, 2011, at 1:50 PM, Andreas Färber wrote:> Hello, > > Running the Debug+Asserts version instead of the Release should give you the file and line of the "unreachable" code. > > AndreasThanks for the suggestion. I recompiled with Debug+Asserts and it shows that the unreachable is in CallingConvLower.cpp:162. Here is the error message: Call result #2 has unhandled type f32UNREACHABLE executed at CallingConvLower.cpp:162! I don't think my backend is modified enough from the MBlaze backend that is in the release to be causing this error. I am however looking through the various files of the backend to try to find where the calling convention might be causing problems with f32 data types. Josef -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110315/eb02e676/attachment.html>
Reasonably Related Threads
- [LLVMdev] mblaze backend: unreachable executed
- [LLVMdev] mblaze backend: unreachable executed
- [LLVMdev] mblaze backend: unreachable executed
- [LLVMdev] mblaze backend: unreachable executed
- [LLVMdev] why dummy asserting base/interface class virtual methods instead of pure virtual methods?