Villmow, Micah
2011-Mar-11 19:11 UTC
[LLVMdev] Accessing an empty machine function before instruction selection?
I'm trying to access the MachineFunctionInfo structure from a pre-ISel pass. In order to do this I have to get access to the MachineFunction and then call getInfo(). Currently in my pass I request it via: void AMDILBarrierDetect::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MachineFunctionAnalysis>(); FunctionPass::getAnalysisUsage(AU); } However, I am getting an assert: assert(NormalCtor && "Cannot call createPass on PassInfo without default ctor!"); First question, is this possible? If so, how do I get NormalCtor to not be NULL? Second question, if I want to pass information from before Instruction selection to after instruction selection, is this the preferred way? If not how? Thanks, Micah -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110311/953aeca4/attachment.html>
Villmow, Micah
2011-Mar-11 20:13 UTC
[LLVMdev] Accessing an empty machine function before instruction selection?
To answer my own question. I added this to getAnalysisUsage and it seems to bypass the assert. AU.setPreservesAll(); Anyone have an idea on why this fixes the problem? Thanks, Micah From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Villmow, Micah Sent: Friday, March 11, 2011 11:11 AM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] Accessing an empty machine function before instruction selection? I'm trying to access the MachineFunctionInfo structure from a pre-ISel pass. In order to do this I have to get access to the MachineFunction and then call getInfo(). Currently in my pass I request it via: void AMDILBarrierDetect::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MachineFunctionAnalysis>(); FunctionPass::getAnalysisUsage(AU); } However, I am getting an assert: assert(NormalCtor && "Cannot call createPass on PassInfo without default ctor!"); First question, is this possible? If so, how do I get NormalCtor to not be NULL? Second question, if I want to pass information from before Instruction selection to after instruction selection, is this the preferred way? If not how? Thanks, Micah -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110311/9c6f8200/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Problemo: createTailDuplicationPass
- [LLVMdev] "Cannot call createPass on PassInfo without default ctor!"
- [LLVMdev] Problem with generating Machine function analysis pass
- [LLVMdev] global control flow graph at machine code level
- [LLVMdev] PassManager again...