Damien Neff
2011-Nov-10 21:01 UTC
[LLVMdev] problem with DwarfEHPrepare::InsertUnwindResumeCalls in multiple JIT context?
Hi, I was wondering if there are any known issues with DwarfEHPrepare::InsertUnwindResumeCalls when using JIT? It appears that the block of code below in this function doesn't correctly handle the case where the rewind function is removed from the module by some other pass (when its unused for instance), and multiple functions are JITed. The RewindFunction variable will get set once, then when the rewind function is removed it never gets updated. Is this just an unsupported use case of calling the JIT multiple times, or am I missing something? Thanks! Damien if (!RewindFunction) { LLVMContext &Ctx = Resumes[0]->getContext(); FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx), Type::getInt8PtrTy(Ctx), false); const char *RewindName = TLI->getLibcallName(RTLIB::UNWIND_RESUME); RewindFunction = F->getParent()->getOrInsertFunction(RewindName, FTy); } ________________________________ This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature. -------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20111110/78ace1cb/attachment.html>
Duncan Sands
2011-Nov-11 04:06 UTC
[LLVMdev] problem with DwarfEHPrepare::InsertUnwindResumeCalls in multiple JIT context?
Hi Damien, the pass wasn't expecting the module to be changing underneath it. It should be easy enough to tweak it to add the declaration whenever it is needed. Please send a patch or open a bug report. Ciao, Duncan.> Hi, I was wondering if there are any known issues with DwarfEHPrepare :: > InsertUnwindResumeCalls when using JIT? It appears that the block of code below > in this function doesn't correctly handle the case where the rewind function is > removed from the module by some other pass (when its unused for instance), and > multiple functions are JITed. The RewindFunction variable will get set once, > then when the rewind function is removed it never gets updated. Is this just an > unsupported use case of calling the JIT multiple times, or am I missing > something? Thanks! > > > Damien > > if (! RewindFunction ) { > > LLVMContext & Ctx = Resumes [0]-> getContext (); > > FunctionType * FTy = FunctionType :: get ( Type :: getVoidTy ( Ctx ), > > Type :: getInt8PtrTy ( Ctx ), false ); > > const char * RewindName = TLI -> getLibcallName ( RTLIB :: UNWIND_RESUME ); > > RewindFunction = F -> getParent ()-> getOrInsertFunction ( RewindName , FTy ); > > } > > > > This e-mail and its attachments are intended only for the individual or entity > to whom it is addressed and may contain information that is confidential, > privileged, inside information, or subject to other restrictions on use or > disclosure. Any unauthorized use, dissemination or copying of this transmission > or the information in it is prohibited and may be unlawful. If you have received > this transmission in error, please notify the sender immediately by return > e-mail, and permanently delete or destroy this e-mail, any attachments, and all > copies (digital or paper). Unless expressly stated in this e-mail, nothing in > this message should be construed as a digital or electronic signature. > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu llvm.cs.uiuc.edu > lists.cs.uiuc.edu/mailman/listinfo/llvmdev