<div dir="ltr"><div><div>Hi,<br></div> Can some one please help me with this problem? From what I understand:<br><br>const PassInfo *PassRegistry::getPassInfo(const void *TI) const in lib/VMCore/PassRegistry.cpp<br><br></div>
method returns 0 when it is expected to return a pass info. I am not sure what PassInfo is expected here. I tried to put a few DEBUG statements within that method but I could not find the information needed. So some pass is not being registered.<br>
<br>Can some one please help me?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 7, 2012 at 7:23 AM, Madhusudan C.S <span dir="ltr"><<a href="mailto:madhusudancs@gmail.com" target="_blank">madhusudancs@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jakob,<br>
<br>I have been trying to learn how the CodeGen passes work and I am playing around with the -debug-pass option. I tried
implementing a bare CallGraphSCCPass based Pass in the CodeGen which
basically does nothing for now. I mostly tried to replicate what
RegAlloc passes do. I did this instead of modifying the existing
RegAlloc passes to use CallGraphSCCPass because that was becoming way
too complicated for simple experiments I was trying when I tried to do
that. I am attaching the diffs of what I actually tried to do for
reference here. It is not really well documented and there is a lot of
copy/paste code there, but well, this is not really the final code to be
submitted or anything, just to play around, so I have not really put
efforts into comments etc. yet.<div><div class="h5"><br>
<br>So when I build LLVM and try to run the pass with the following command:<br>$ llc --debug -cgregalloc=cg <$HOME/cpptry/manyfuncs.bc <br><br>I get the following error.<br><br>Args: llc --debug -cgregalloc=cg <br>Subtarget features: SSELevel 6, 3DNowLevel 0, 64bit 1<br>
Pass ID not registered<br>UNREACHABLE executed at /media/python/workspace/llvm/</div></div><div><div><div class="h5">lib/CodeGen/Passes.cpp:324!<br>0 llc 0x0000000001453dfe<br>1 llc 0x00000000014542fa<br>
<span>2</span> libpthread.so.0 0x00007f020b750cb0<br>
3 libc.so.6 0x00007f020a99f425 gsignal + 53<br>4 libc.so.6 0x00007f020a9a2b8b abort + 379<br>5 llc 0x000000000143b1a6<br>6 llc 0x0000000000f3cb02 llvm::TargetPassConfig::addPass(void const*) + 146<br>
7 llc 0x0000000000f3ddef llvm::TargetPassConfig::addCGRegAlloc(llvm::CallGraphSCCPass*) + 47<br>8 llc 0x0000000000f3d7df llvm::TargetPassConfig::addMachinePasses() + 719<br>9 llc 0x0000000000e5a3af<br>
10 llc 0x0000000000e5994c llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::PassManagerBase&, llvm::formatted_raw_ostream&, llvm::TargetMachine::CodeGenFileType, bool, void const*, void const*) + 92<br>
11 llc 0x00000000005f6002 main + 4946<br>12 libc.so.6 0x00007f020a98a76d __libc_start_main + 237<br>13 llc 0x00000000005f4bd1<br>Stack dump:<br>0. Program arguments: llc --debug -cgregalloc=cg <br>
Aborted (core dumped)<br><br></div></div>I am not really sure, why it says "Pass ID
is not registered". I did quite a lot of internet searching about it and
whatever I try to look for I end up on the exact LLVM line of code
which prints this error line. So, I am not sure what is going on. Is this because CallGraphSCCPass does not register anything
with the MachineFunctionPass-es? Or is this because CallGraphSCCPass
does not do some magic which is specific to CodeGen passes? Can you
please help me with this a bit? May be some pointers?<br>
</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 2:03 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk" target="_blank">stoklund@2pi.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br>
On Oct 31, 2012, at 1:41 PM, Madhusudan C.S <<a href="mailto:madhusudancs@gmail.com" target="_blank">madhusudancs@gmail.com</a>> wrote:<br>
<br>
> I have spent last 4 weeks trying to figure out how to implement<br>
> Interprocedural Register Allocation. I must admit that I was really<br>
> overwhelmed with LLVM's codebase while trying to figure this out :)<br>
> There is so much to know! I think I have reached a point where I<br>
> have some sort of basic understanding of what needs to be done,<br>
> but I need some help from here on. So here is the summary of<br>
> what I know and for what I need more help.<br>
><br>
> I see that lib/CodeGen/Passes.cpp adds PrologEpilogInserter (PEI<br>
> henceforth) pass after the RegAlloc pass. Do I understand correctly<br>
> that LLVM first performs a given pass on all the functions before<br>
> moving to the next pass?<br>
<br>
</div>No, it's the other way around.<br>
<br>
You may want to read up on the pass manager and play with the -debug-pass option.<br>
<span><font color="#888888"><br>
/jakob<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><div class="im">-- <br>Thanks and regards,<br> Madhusudan.C.S<br><br><br>
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks and regards,<br> Madhusudan.C.S<br><br>
</div>