Hi all, I wrote 2 passes and I want to make run llvm run the passes in this order: -mem2reg -load=…/mypass1.dylib -mypass1 -load=…/mypass2.dylib -mypass2 -O1 -O2 -O3 I know I can do this by manually passing them as an argument to opt. Is there any way to force this sequence directly from clang? I am asking this because I am trying to compile a program and I can specify in the ./configure the CC and CFLAGS options. So if there is an option to force the sequence directly from clang it would be the easiest thing to do. If there is not, is there a way to specify this order by modifying the llvm code? I am new to the PassManager and PassRegistry and I am not sure if I should use them, therefore every detailed procedure will be appreciated. Thank you in advance, Niko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131006/3fb09704/attachment.html>
On 10/5/13 11:17 PM, Niko Zarzani wrote:> > Hi all, > > > I wrote 2 passes and I want to make run llvm run the passes in this order: > > -mem2reg -load=.../mypass1.dylib -mypass1 -load=.../mypass2.dylib > -mypass2 -O1 -O2 -O3 > > > I know I can do this by manually passing them as an argument to opt. > > > Is there any way to force this sequence directly from clang? >To the best of my knowledge, no, there is no mechanism in LLVM that does this for two optimization passes. You can do it, however, if mypass1 is an analysis pass that does not modify the bitcode and mypass2 is either an analysis pass or an optimization pass. The LLVM PassManager should run all required prerequisite analysis passes before an optimization pass that requires them in getAnalysisUsage(). -- John T. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131006/734985f6/attachment.html>
On Oct 5, 2013, at 9:17 PM, Niko Zarzani <koni10 at hotmail.it> wrote:> Hi all, > > I wrote 2 passes and I want to make run llvm run the passes in this order: > -mem2reg -load=…/mypass1.dylib -mypass1 -load=…/mypass2.dylib -mypass2 -O1 -O2 -O3 > > I know I can do this by manually passing them as an argument to opt. > > Is there any way to force this sequence directly from clang? > > I am asking this because I am trying to compile a program and I can specify in the ./configure the CC and CFLAGS options. So if there is an option to force the sequence directly from clang it would be the easiest thing to do. > > If there is not, is there a way to specify this order by modifying the llvm code? > I am new to the PassManager and PassRegistry and I am not sure if I should use them, therefore every detailed procedure will be appreciated.In answer to the last part of your question, maybe you're looking for PassManagerBuilder::populateModulePassManager. -Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131006/9028e1d9/attachment.html>
Thank you all, I solved my problem by writing my own shellscript with the sequence of call to clang>opt>llc>clang and used it as my compiler in the CC option of the ./configure script. Subject: Re: [LLVMdev] Pass sequence From: atrick at apple.com Date: Sun, 6 Oct 2013 18:28:40 -0700 CC: llvmdev at cs.uiuc.edu To: koni10 at hotmail.it On Oct 5, 2013, at 9:17 PM, Niko Zarzani <koni10 at hotmail.it> wrote:Hi all, I wrote 2 passes and I want to make run llvm run the passes in this order: -mem2reg -load=…/mypass1.dylib -mypass1 -load=…/mypass2.dylib -mypass2 -O1 -O2 -O3 I know I can do this by manually passing them as an argument to opt. Is there any way to force this sequence directly from clang? I am asking this because I am trying to compile a program and I can specify in the ./configure the CC and CFLAGS options. So if there is an option to force the sequence directly from clang it would be the easiest thing to do. If there is not, is there a way to specify this order by modifying the llvm code?I am new to the PassManager and PassRegistry and I am not sure if I should use them, therefore every detailed procedure will be appreciated. In answer to the last part of your question, maybe you're looking for PassManagerBuilder::populateModulePassManager. -Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131008/230dbece/attachment.html>