Hi Josef,> Okay, I've done a lot more testing and I now have a .bc file that compiles for x86, sparc, mips but refuses to compile for the mblaze and powerPC backends because of the calling convention. Is there anyone that would know how to fix the microblaze calling convention or point me in the right direction on how to fix it?what does "refuses to compile" mean? I.e. what error do you get? Ciao, Duncan.> > The lines in the .bc that I believe to be causing the problem are the following: > > %196 = call %0 @_Z13gatherDiffuseRK3vecS_S1_RKfS3_Pii(%struct.vec* %normal, double %tmp629, float %174, %struct.vec* %light_position, float* %nohit, float* %epsilon, i32* %66, i32 %5) nounwind > > and > > define linkonce_odr %0 @_Z13gatherDiffuseRK3vecS_S1_RKfS3_Pii(%struct.vec* nocapture %normal, double %hit_point.0, float %hit_point.1, %struct.vec* nocapture %light_position, float* nocapture %nohit, float* nocapture %epsilon, i32* nocapture %stack, i32 %start_bvh) nounwind inlinehint ssp { > > which then goes into the body of the function. > > Josef > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> what does "refuses to compile" mean? I.e. what error do you get? >Specifically I get this message when compiling with the default -mattr: Call result #2 has unhandled type i32 UNREACHABLE executed at CallingConvLower.cpp:162! 0 llc 0x0000000100a1e115 PrintStackTrace(void*) + 38 1 llc 0x0000000100a1e6d0 SignalHandler(int) + 254 2 libSystem.B.dylib 0x00007fff82adf67a _sigtramp + 26 3 llc 0x000000010053233c llvm::SmallVectorImpl<unsigned int>::push_back(unsigned int const&) + 104 4 llc 0x000000010002d3d3 raise + 27 5 llc 0x000000010002d3e3 abort + 14 6 llc 0x0000000100a0a9e3 llvm::report_fatal_error(llvm::Twine const&) + 0 7 llc 0x00000001005df5f3 llvm::CCState::AnalyzeCallResult(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) + 261 8 llc 0x00000001000b62ac llvm::MBlazeTargetLowering::LowerCallResult(llvm::SDValue, llvm::SDValue, llvm::CallingConv::ID, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const + 166 9 llc 0x00000001000b72c6 llvm::MBlazeTargetLowering::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 + 3640 10 llc 0x00000001004fffe8 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 + 2058 11 llc 0x000000010050733a llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2470 12 llc 0x0000000100519d01 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 4381 13 llc 0x0000000100522bc4 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 1220 14 llc 0x00000001005286c9 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 105 15 llc 0x000000010054067f llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 59 16 llc 0x0000000100541088 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2396 17 llc 0x0000000100541730 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 762 18 llc 0x000000010064e051 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 85 19 llc 0x000000010095f6ea llvm::FPPassManager::runOnFunction(llvm::Function&) + 350 20 llc 0x000000010095f8bd llvm::FPPassManager::runOnModule(llvm::Module&) + 81 21 llc 0x000000010095f3ba llvm::MPPassManager::runOnModule(llvm::Module&) + 384 22 llc 0x0000000100960b6b llvm::PassManagerImpl::run(llvm::Module&) + 111 23 llc 0x0000000100960bcd llvm::PassManager::run(llvm::Module&) + 33 24 llc 0x000000010003073f main + 2305 25 llc 0x000000010002f824 start + 52 and Illegal Instruction returned to my shell. When I enable FPU the type changes to f32 but the rest of the error is the same. Josef
> > what does "refuses to compile" mean? I.e. what error do you get? >Specifically I get this message when compiling with the default -mattr: Call result #2 has unhandled type i32 UNREACHABLE executed at CallingConvLower.cpp:162! 0 llc 0x0000000100a1e115 PrintStackTrace(void*) + 38 1 llc 0x0000000100a1e6d0 SignalHandler(int) + 254 2 libSystem.B.dylib 0x00007fff82adf67a _sigtramp + 26 3 llc 0x000000010053233c llvm::SmallVectorImpl<unsigned int>::push_back(unsigned int const&) + 104 4 llc 0x000000010002d3d3 raise + 27 5 llc 0x000000010002d3e3 abort + 14 6 llc 0x0000000100a0a9e3 llvm::report_fatal_error(llvm::Twine const&) + 0 7 llc 0x00000001005df5f3 llvm::CCState::AnalyzeCallResult(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) + 261 8 llc 0x00000001000b62ac llvm::MBlazeTargetLowering::LowerCallResult(llvm::SDValue, llvm::SDValue, llvm::CallingConv::ID, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const + 166 9 llc 0x00000001000b72c6 llvm::MBlazeTargetLowering::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 + 3640 10 llc 0x00000001004fffe8 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 + 2058 11 llc 0x000000010050733a llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2470 12 llc 0x0000000100519d01 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 4381 13 llc 0x0000000100522bc4 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 1220 14 llc 0x00000001005286c9 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 105 15 llc 0x000000010054067f llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 59 16 llc 0x0000000100541088 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2396 17 llc 0x0000000100541730 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 762 18 llc 0x000000010064e051 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 85 19 llc 0x000000010095f6ea llvm::FPPassManager::runOnFunction(llvm::Function&) + 350 20 llc 0x000000010095f8bd llvm::FPPassManager::runOnModule(llvm::Module&) + 81 21 llc 0x000000010095f3ba llvm::MPPassManager::runOnModule(llvm::Module&) + 384 22 llc 0x0000000100960b6b llvm::PassManagerImpl::run(llvm::Module&) + 111 23 llc 0x0000000100960bcd llvm::PassManager::run(llvm::Module&) + 33 24 llc 0x000000010003073f main + 2305 25 llc 0x000000010002f824 start + 52 and Illegal Instruction returned to my shell. When I enable FPU the type changes to f32 but the rest of the error is the same. Josef