[LLVMdev] About writing a modulePass in addPreEmitPass() for NVPTX

Justin Holewinski justin.holewinski at gmail.com
Fri Jun 21 16:44:19 PDT 2013


Are you sure you are initializing your pass properly?  Can you show a
stripped down version of your pass?


On Fri, Jun 21, 2013 at 7:27 AM, Anthony Yu <swpenim at gmail.com> wrote:

> Hello,
>
> I want to write a modulePass in addPreEmitPass() for NVPTX, but I
> encounter an assertion failed when executing clang.
>
> Here is my error message.
> ====
> Pass 'NVPTX Assembly Printer' is not initialized.
> Verify if there is a pass dependency cycle.
> Required Passes:
> llc: /home/pyyu/local/llvm/lib/IR/PassManager.cpp:637: void
> llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI &&
> "Expected required passes to be initialized"' failed.
> 0  llc             0x000000000176cd86
> llvm::sys::PrintStackTrace(_IO_FILE*) + 38
> 1  llc             0x000000000176d00d
> 2  llc             0x000000000176ca5c
> 3  libpthread.so.0 0x00007f9867638cb0
> 4  libc.so.6       0x00007f986688a425 gsignal + 53
> 5  libc.so.6       0x00007f986688db8b abort + 379
> 6  libc.so.6       0x00007f98668830ee
> 7  libc.so.6       0x00007f9866883192
> 8  llc             0x00000000016ec3b1
> llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 983
> 9  llc             0x00000000016f2990
> 10 llc             0x00000000016f0e91 llvm::PassManager::add(llvm::Pass*)
> + 39
> 11 llc             0x00000000011c119b
> llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::PassManagerBase&,
> llvm::formatted_raw_ostream&, llvm::TargetMachine::CodeGenFileType, bool,
> void const*, void const*) + 1705
> 12 llc             0x00000000008c08b5
> 13 llc             0x00000000008bf8cd main + 237
> 14 libc.so.6       0x00007f986687576d __libc_start_main + 237
> 15 llc             0x00000000008bf229
> =====
>
> What my modulePass does is to print all of the function name in the
> module.
> I use setPreservesAll() in getAnalysisUsage(), so there isn't any pass
> dependency cycle.
>
> I notice that NVPTXAsmPrinter says it does static initialization. I'm not
> sure if it is related to this error.
>
> Is there any advice to solve this error? And I also want to know if there
> is a way to verify if there is a pass dependency cycle.
>
>
> Thanks for any advice.
> Antony Yu
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130621/d5318387/attachment.html>


More information about the llvm-dev mailing list