Is there a beginner's tutorial/documentation on how to write passes for the llc tool? I've managed to write some simple analysis passes for the opt tool but can't figure out how to do the same for llc. What is the proper way to integrate a new MachineFunction pass with llc? Is there a way to register passes and selectively enable them on the command line (as with opt) or do I need to hard code it into llc.cpp? I would like to be able to write a pass that looks at MachineFunctions and inserts instructions right before register allocation (but after all other optimization/instruction selection passes). Any direction/ advice would be of great help. Thanks!
On Sun, Jul 12, 2009 at 2:09 PM, shu<shuguang.feng at gmail.com> wrote:> Is there a beginner's tutorial/documentation on how to write passes > for the llc tool? I've managed to write some simple analysis passes > for the opt tool but can't figure out how to do the same for llc. > What is the proper way to integrate a new MachineFunction pass with > llc? Is there a way to register passes and selectively enable them on > the command line (as with opt) or do I need to hard code it into > llc.cpp? > > I would like to be able to write a pass that looks at MachineFunctions > and inserts instructions right before register allocation (but after > all other optimization/instruction selection passes). Any direction/ > advice would be of great help. Thanks!llc uses Target.addPassesToEmit* interface to add passes. You can insert your pass at appropriate place here. - Devang
Devang Patel wrote:> On Sun, Jul 12, 2009 at 2:09 PM, shu<shuguang.feng at gmail.com> wrote: > >> Is there a beginner's tutorial/documentation on how to write passes >> for the llc tool? I've managed to write some simple analysis passes >> for the opt tool but can't figure out how to do the same for llc. >> What is the proper way to integrate a new MachineFunction pass with >> llc? Is there a way to register passes and selectively enable them on >> the command line (as with opt) or do I need to hard code it into >> llc.cpp? >> >> I would like to be able to write a pass that looks at MachineFunctions >> and inserts instructions right before register allocation (but after >> all other optimization/instruction selection passes). Any direction/ >> advice would be of great help. Thanks! >> > > llc uses Target.addPassesToEmit* interface to add passes. You can > insert your pass at appropriate place here. > > - > Devang > >One related question. Can we write CallGraphSCCPass in llc? - Sanjiv
Thanks Devang. A former office mate pointed me toward the LLVMTargetMachine::addPreRegAlloc() function. I appreciate your quick response! -shuguang On Jul 14, 2:06 pm, Devang Patel <devang.pa... at gmail.com> wrote:> On Sun, Jul 12, 2009 at 2:09 PM, shu<shuguang.f... at gmail.com> wrote: > > Is there a beginner's tutorial/documentation on how to write passes > > for thellctool? I've managed to write some simple analysis passes > > for the opt tool but can't figure out how to do the same forllc. > > What is the proper way to integrate a new MachineFunction pass with > >llc? Is there a way to register passes and selectively enable them on > > the command line (as with opt) or do I need to hard code it into > >llc.cpp? > > > I would like to be able to write a pass that looks at MachineFunctions > > and inserts instructions right before register allocation (but after > > all other optimization/instruction selection passes). Any direction/ > > advice would be of great help. Thanks! > > llcuses Target.addPassesToEmit* interface to add passes. You can > insert your pass at appropriate place here. > > - > Devang > > _______________________________________________ > LLVM Developers mailing list > LLVM... at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] Writing pass for llc
- [LLVMdev] Writing pass for llc
- [LLVMdev] LLVM Hello Pass load error when using opt -load Hello.so
- [LLVMdev] LLVM Hello Pass load error when using opt -load Hello.so
- I'm writing this letter to enquire where can I download the package of "lmtest".