hi, when using the execution engine (no matter, if JIT or Interpreter) i get the following assertion as soon as i use boost::shared_ptr: /build/buildd/llvm-2.5/lib/Target/X86/X86CodeEmitter.cpp:522: void<unnamed>::Emitter::emitInstruction(const llvm::MachineInstr&, const llvm::TargetInstrDesc*): Assertion `0 && "JIT does not support inline asm!\n"' failed. how can i find out which instruction is executed at this point or in which function we are currently? i also attached a very small example, which triggers the assertion when run with lli. thanks a lot in advance, stefan. -------------- next part -------------- A non-text attachment was scrubbed... Name: test.cpp Type: text/x-c++src Size: 160 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090721/f5d40e79/attachment.cpp>
Stefan Weigert wrote:> hi, > > when using the execution engine (no matter, if JIT or Interpreter) i get the > following assertion as soon as i use boost::shared_ptr: > > /build/buildd/llvm-2.5/lib/Target/X86/X86CodeEmitter.cpp:522: > void<unnamed>::Emitter::emitInstruction(const llvm::MachineInstr&, const > llvm::TargetInstrDesc*): Assertion `0 && "JIT does not support inline asm!\n"' > failed. > > how can i find out which instruction is executed at this point or in which > function we are currently? > > i also attached a very small example, which triggers the assertion when run > with lli.I do not know if there's general mechanism in LLVM to answer your question, but you probably don't even need that. 1. Compiling with -save-temps will give you a preprocessed source, and you can grep it for "asm". 2. The assembler most likely comes from boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp. Defining either BOOST_SP_DISABLE_THREAD, or BOOST_SP_USE_PTHREADS will work around this problem. - Volodya
On 2009-07-21 14:27, Stefan Weigert wrote:> hi, > > when using the execution engine (no matter, if JIT or Interpreter) i get the > following assertion as soon as i use boost::shared_ptr: > > /build/buildd/llvm-2.5/lib/Target/X86/X86CodeEmitter.cpp:522: > void<unnamed>::Emitter::emitInstruction(const llvm::MachineInstr&, const > llvm::TargetInstrDesc*): Assertion `0 && "JIT does not support inline asm!\n"' > failed. > > how can i find out which instruction is executed at this point or in which > function we are currently? > > i also attached a very small example, which triggers the assertion when run > with lli. > >llvm-g++ -g ~/test.cpp -o test.bc -c -emit-llvm opt -print-dbginfo test.bc > test.ll Then open test.ll, and look for 'asm', and closest sourceline: function _ZN5boost6detail23atomic_exchange_and_addEPii entry:; (sp_counted_base_gcc_x86.hpp:50) ... %asmtmp = call i32 asm sideeffect "lock\0A\09xadd $1, $0", "=*m,=r,*m,1,~{dirflag},~{fpsr},~{flags},~{cc},~{memory}"(i32* %4, i32* %5, i32 %6) nounwind ; <i32> [#uses=1] store i32 %asmtmp, i32* %r; %r is variable r of type int declared at sp_counted_base_gcc_x86.hpp:41 ; sp_counted_base_gcc_x86.hpp:52 echo _ZN5boost6detail23atomic_exchange_and_addEPii | c++filt boost::detail::atomic_exchange_and_add(int*, int Best regards, --Edwin
hi, thanks for your quick replies. -DBOOST_SP_USE_PTHREADS worked indeed. however, i didn't measure the performance but i would assume that the boost developers had a good reason for using assembler in this context. will llvm ever support inline assembly? is there anybody who is working on that? thanks, stefan. On Tuesday 21 July 2009 01:54:20 pm Vladimir Prus wrote:> Stefan Weigert wrote: > > hi, > > > > when using the execution engine (no matter, if JIT or Interpreter) i get > > the following assertion as soon as i use boost::shared_ptr: > > > > /build/buildd/llvm-2.5/lib/Target/X86/X86CodeEmitter.cpp:522: > > void<unnamed>::Emitter::emitInstruction(const llvm::MachineInstr&, const > > llvm::TargetInstrDesc*): Assertion `0 && "JIT does not support inline > > asm!\n"' failed. > > > > how can i find out which instruction is executed at this point or in > > which function we are currently? > > > > i also attached a very small example, which triggers the assertion when > > run with lli. > > I do not know if there's general mechanism in LLVM to answer your question, > but you probably don't even need that. > > 1. Compiling with -save-temps will give you a preprocessed source, and you > can grep it for "asm". > > 2. The assembler most likely comes from > boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp. Defining either > BOOST_SP_DISABLE_THREAD, or BOOST_SP_USE_PTHREADS will work around this > problem. > > - Volodya > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] boost shared pointer & llvm
- [LLVMdev] boost shared pointer & llvm
- [LLVMdev] New type of smart pointer for LLVM
- [LLVMdev] New type of smart pointer for LLVM
- [LLVMdev] Why is "typedef boost::shared_ptr<MyClass> MyClass_ptr" named "struct.boost::MyClass_ptr" by llvm-g++?