It's not being executed. I'm both trying to print via outs() and add info via STATISTIC, neither is occurring. On Mon, Jul 14, 2014 at 12:22 PM, Justin Holewinski <jholewinski at nvidia.com> wrote:> On Mon, 2014-07-14 at 08:31 -0700, Ryan Taylor wrote: > > Where is the documentation about registering a machine pass? I'm > > unable to find it. > > > > > > I have built a machine function pass similar to the one found in > > HexagonHardwareLoops.cpp. So I have generated a machine pass.cpp file, > > modified 'Target'.h and 'Target'TargetMachine.cpp (to add pass via > > addPass() in the addPreRegAlloc()). All this builds/compiles fine. > > > > > > When running llc the pass does not get executed. > > > > > > I seem to be missing some steps? Potentially registration of the > > machine pass? > > That should be all you need to do. Are you running in a debugger and > making sure your added addPass() call is actually being executed? > > > > > > Thanks. > > > ----------------------------------------------------------------------------------- > This email message is for the sole use of the intended recipient(s) and > may contain > confidential information. Any unauthorized review, use, disclosure or > distribution > is prohibited. If you are not the intended recipient, please contact the > sender by > reply email and destroy all copies of the original message. > > ----------------------------------------------------------------------------------- >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140714/360cc1e3/attachment.html>
On Mon, 2014-07-14 at 10:00 -0700, Ryan Taylor wrote:> It's not being executed. I'm both trying to print via outs() and add > info via STATISTIC, neither is occurring.Did you try running in a debugger to make sure addPass() is called? Or if a debugger is unavailable, putting an outs() statement with the addPass() call? That would at least rule out addPass() not being called.> > On Mon, Jul 14, 2014 at 12:22 PM, Justin Holewinski > <jholewinski at nvidia.com> wrote: > On Mon, 2014-07-14 at 08:31 -0700, Ryan Taylor wrote: > > Where is the documentation about registering a machine pass? > I'm > > unable to find it. > > > > > > I have built a machine function pass similar to the one > found in > > HexagonHardwareLoops.cpp. So I have generated a machine > pass.cpp file, > > modified 'Target'.h and 'Target'TargetMachine.cpp (to add > pass via > > addPass() in the addPreRegAlloc()). All this builds/compiles > fine. > > > > > > When running llc the pass does not get executed. > > > > > > I seem to be missing some steps? Potentially registration of > the > > machine pass? > > > That should be all you need to do. Are you running in a > debugger and > making sure your added addPass() call is actually being > executed? > > > > > > Thanks. > > ----------------------------------------------------------------------------------- > This email message is for the sole use of the intended > recipient(s) and may contain > confidential information. Any unauthorized review, use, > disclosure or distribution > is prohibited. If you are not the intended recipient, please > contact the sender by > reply email and destroy all copies of the original message. > ----------------------------------------------------------------------------------- > >
Justin,
Yes, I had/have this:
bool MyTargetPassConfig::addPreRegAlloc() {
outs()<<"PreRegAllocPass\n";
addPass(createMyPass());
return true;
}
I do not see this being printed.
On Mon, Jul 14, 2014 at 1:07 PM, Justin Holewinski <jholewinski at
nvidia.com>
wrote:
> On Mon, 2014-07-14 at 10:00 -0700, Ryan Taylor wrote:
> > It's not being executed. I'm both trying to print via outs()
and add
> > info via STATISTIC, neither is occurring.
>
> Did you try running in a debugger to make sure addPass() is called? Or
> if a debugger is unavailable, putting an outs() statement with the
> addPass() call? That would at least rule out addPass() not being
> called.
>
> >
> > On Mon, Jul 14, 2014 at 12:22 PM, Justin Holewinski
> > <jholewinski at nvidia.com> wrote:
> > On Mon, 2014-07-14 at 08:31 -0700, Ryan Taylor wrote:
> > > Where is the documentation about registering a machine
pass?
> > I'm
> > > unable to find it.
> > >
> > >
> > > I have built a machine function pass similar to the one
> > found in
> > > HexagonHardwareLoops.cpp. So I have generated a machine
> > pass.cpp file,
> > > modified 'Target'.h and
'Target'TargetMachine.cpp (to add
> > pass via
> > > addPass() in the addPreRegAlloc()). All this
builds/compiles
> > fine.
> > >
> > >
> > > When running llc the pass does not get executed.
> > >
> > >
> > > I seem to be missing some steps? Potentially registration
of
> > the
> > > machine pass?
> >
> >
> > That should be all you need to do. Are you running in a
> > debugger and
> > making sure your added addPass() call is actually being
> > executed?
> > >
> > >
> > > Thanks.
> >
> >
>
-----------------------------------------------------------------------------------
> > This email message is for the sole use of the intended
> > recipient(s) and may contain
> > confidential information. Any unauthorized review, use,
> > disclosure or distribution
> > is prohibited. If you are not the intended recipient, please
> > contact the sender by
> > reply email and destroy all copies of the original message.
> >
>
-----------------------------------------------------------------------------------
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140714/25de1ccd/attachment.html>
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:
static RegisterPass<MyMachinePass> X("mypass", "My Machine
Pass");
Check http://llvm.org/doxygen/classllvm_1_1TargetPassConfig.html to get an
overview of the possible back-end stages where you can insert your pass via
the addPrexxx() interface.
Good luck,
Rafael
On Mon, Jul 14, 2014 at 2:07 PM, Justin Holewinski <jholewinski at
nvidia.com>
wrote:
> On Mon, 2014-07-14 at 10:00 -0700, Ryan Taylor wrote:
> > It's not being executed. I'm both trying to print via outs()
and add
> > info via STATISTIC, neither is occurring.
>
> Did you try running in a debugger to make sure addPass() is called? Or
> if a debugger is unavailable, putting an outs() statement with the
> addPass() call? That would at least rule out addPass() not being
> called.
>
> >
> > On Mon, Jul 14, 2014 at 12:22 PM, Justin Holewinski
> > <jholewinski at nvidia.com> wrote:
> > On Mon, 2014-07-14 at 08:31 -0700, Ryan Taylor wrote:
> > > Where is the documentation about registering a machine
pass?
> > I'm
> > > unable to find it.
> > >
> > >
> > > I have built a machine function pass similar to the one
> > found in
> > > HexagonHardwareLoops.cpp. So I have generated a machine
> > pass.cpp file,
> > > modified 'Target'.h and
'Target'TargetMachine.cpp (to add
> > pass via
> > > addPass() in the addPreRegAlloc()). All this
builds/compiles
> > fine.
> > >
> > >
> > > When running llc the pass does not get executed.
> > >
> > >
> > > I seem to be missing some steps? Potentially registration
of
> > the
> > > machine pass?
> >
> >
> > That should be all you need to do. Are you running in a
> > debugger and
> > making sure your added addPass() call is actually being
> > executed?
> > >
> > >
> > > Thanks.
> >
> >
>
-----------------------------------------------------------------------------------
> > This email message is for the sole use of the intended
> > recipient(s) and may contain
> > confidential information. Any unauthorized review, use,
> > disclosure or distribution
> > is prohibited. If you are not the intended recipient, please
> > contact the sender by
> > reply email and destroy all copies of the original message.
> >
>
-----------------------------------------------------------------------------------
> >
> >
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140714/0e8a5963/attachment.html>