sangeeta chowdhary via llvm-dev
2018-Jan-14 00:14 UTC
[llvm-dev] Integrating llvm pass with pass manager
I have taken SimplePass and added in Transform directory, “libLLVMSimplePass.a” is built but I can not see this pass in opt —help. I don’t even see the name of pass while registering it in the example.> On Jan 13, 2018, at 7:35 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote: > > On 13 Jan 2018, at 03:45, Craig Topper via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> I’m not sure what the correct way to do this is. I think your plugin needs to do something to tell clang/llvm when to run the pass. I’ll try to look later when I’m back at a computer. > > You need to use RegisterStandardPasses to add it to the default pipeline automatically. You can find an example here: > > https://github.com/CompilerTeaching/SimplePass/blob/ba5248a9ea0bd9e1fab3b1f8a5c85d6e0db57acd/SimplePass.cc#L116 > > David >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180113/8ec8b819/attachment.html>
David Chisnall via llvm-dev
2018-Jan-15 13:21 UTC
[llvm-dev] Integrating llvm pass with pass manager
On 14 Jan 2018, at 00:14, sangeeta chowdhary <sangitachowdhary at gmail.com> wrote:> > I have taken SimplePass and added in Transform directory, “libLLVMSimplePass.a” is built but I can not see this pass in opt —help. I don’t even see the name of pass while registering it in the example.The SimplePass example is intended to be built out of tree, so I’ve no idea what happens if you try building it in tree. I wouldn’t expect to see it in the opt --help output, because it doesn’t define its own command-line options, it just adds itself to the default optimiser pipeline (at the end, and even if you’re running at -O0). You can see that it works by building it with its own CMake build system and then passing -Xclang -load -Xclang ./SimplePass.so to your clang command line. David
sangeeta chowdhary via llvm-dev
2018-Jan-15 13:28 UTC
[llvm-dev] Integrating llvm pass with pass manager
Thats not what I am looking for. I want to run it with clang by just giving name of my pass. I have expalined it in my previous mail. On Jan 15, 2018 8:21 AM, "David Chisnall" <David.Chisnall at cl.cam.ac.uk> wrote:> On 14 Jan 2018, at 00:14, sangeeta chowdhary <sangitachowdhary at gmail.com> > wrote: > > > > I have taken SimplePass and added in Transform directory, > “libLLVMSimplePass.a” is built but I can not see this pass in opt —help. I > don’t even see the name of pass while registering it in the example. > > The SimplePass example is intended to be built out of tree, so I’ve no > idea what happens if you try building it in tree. I wouldn’t expect to see > it in the opt --help output, because it doesn’t define its own command-line > options, it just adds itself to the default optimiser pipeline (at the end, > and even if you’re running at -O0). You can see that it works by building > it with its own CMake build system and then passing -Xclang -load -Xclang > ./SimplePass.so to your clang command line. > > David > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180115/6b178a65/attachment.html>