<div dir="ltr"><div>Rafael,</div><div><br></div><div> Ok. Looks like addPreRegAlloc is a valid back-end stage so that should be fine. Also, I'm curious because none of the documentation/code samples I've seen register machine passes this way. For example, HexagonHardwareLoops.</div>
<div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 1:21 PM, Rafael Auler <span dir="ltr"><<a href="mailto:rafaelauler@gmail.com" target="_blank">rafaelauler@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Use llc -debug-pass=Structure to check if your pass is included in the back-end pipeline. You should register your pass using the same idiom to register a regular IR pass. Like this:<div>
static RegisterPass<MyMachinePass> X("mypass", "My Machine Pass");<br>
</div><div><br></div><div>Check <a href="http://llvm.org/doxygen/classllvm_1_1TargetPassConfig.html" target="_blank">http://llvm.org/doxygen/classllvm_1_1TargetPassConfig.html</a> to get an overview of the possible back-end stages where you can insert your pass via the addPrexxx() interface.</div>
<div><br></div><div>Good luck,</div><div>Rafael</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Jul 14, 2014 at 2:07 PM, Justin Holewinski <span dir="ltr"><<a href="mailto:jholewinski@nvidia.com" target="_blank">jholewinski@nvidia.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div class="h5"><div>On Mon, 2014-07-14 at 10:00 -0700, Ryan Taylor wrote:<br>
> It's not being executed. I'm both trying to print via outs() and add<br>
> info via STATISTIC, neither is occurring.<br>
<br>
</div>Did you try running in a debugger to make sure addPass() is called? Or<br>
if a debugger is unavailable, putting an outs() statement with the<br>
addPass() call? That would at least rule out addPass() not being<br>
called.<br>
<div><div><br>
><br>
> On Mon, Jul 14, 2014 at 12:22 PM, Justin Holewinski<br>
> <<a href="mailto:jholewinski@nvidia.com" target="_blank">jholewinski@nvidia.com</a>> wrote:<br>
> On Mon, 2014-07-14 at 08:31 -0700, Ryan Taylor wrote:<br>
> > Where is the documentation about registering a machine pass?<br>
> I'm<br>
> > unable to find it.<br>
> ><br>
> ><br>
> > I have built a machine function pass similar to the one<br>
> found in<br>
> > HexagonHardwareLoops.cpp. So I have generated a machine<br>
> pass.cpp file,<br>
> > modified 'Target'.h and 'Target'TargetMachine.cpp (to add<br>
> pass via<br>
> > addPass() in the addPreRegAlloc()). All this builds/compiles<br>
> fine.<br>
> ><br>
> ><br>
> > When running llc the pass does not get executed.<br>
> ><br>
> ><br>
> > I seem to be missing some steps? Potentially registration of<br>
> the<br>
> > machine pass?<br>
><br>
><br>
> That should be all you need to do. Are you running in a<br>
> debugger and<br>
> making sure your added addPass() call is actually being<br>
> executed?<br>
> ><br>
> ><br>
> > Thanks.<br>
><br>
> -----------------------------------------------------------------------------------<br>
> This email message is for the sole use of the intended<br>
> recipient(s) and may contain<br>
> confidential information. Any unauthorized review, use,<br>
> disclosure or distribution<br>
> is prohibited. If you are not the intended recipient, please<br>
> contact the sender by<br>
> reply email and destroy all copies of the original message.<br>
> -----------------------------------------------------------------------------------<br>
><br>
><br>
<br>
</div></div></div></div><div><div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>