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

Anthony Yu swpenim at gmail.com
Fri Jun 21 04:27:18 PDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130621/dab51f7d/attachment.html>


More information about the llvm-dev mailing list