Hi, I've written a couple of passes, and I intend to use them using llvm-ld (loading works fine). However, I can't seem to figure out how to put them first, i.e. before all other optimizations (inlining, internalizing, ... should only kick in after my passes). Omitting AnalysisUsage::setPreservesAll() doesn't help and there is no AnalysisUsage::invalidateAll(). Does anybody know a workaround? Kind regards, Bram Adams GH-SEL, INTEC, Ghent University (Belgium)
Chris Lattner
2006-Sep-18 17:21 UTC
[LLVMdev] Manipulate order of optimizations in llvm-ld
On Mon, 18 Sep 2006, Bram Adams wrote:> I've written a couple of passes, and I intend to use them using llvm-ld > (loading works fine). However, I can't seem to figure out how to put > them first, i.e. before all other optimizations (inlining, > internalizing, ... should only kick in after my passes). > > Omitting AnalysisUsage::setPreservesAll() doesn't help and there is no > AnalysisUsage::invalidateAll(). Does anybody know a workaround?One solution is to use gccld/llvm-ld with the -disable-opt option, then run a completely custom series of passes with "opt". -Chris -- http://nondot.org/sabre/ http://llvm.org/
Hi Bram, On Mon, 2006-09-18 at 17:27 +0200, Bram Adams wrote:> Hi, > > I've written a couple of passes, and I intend to use them using llvm-ld > (loading works fine).That's good to hear :)> However, I can't seem to figure out how to put > them first, i.e. before all other optimizations (inlining, > internalizing, ... should only kick in after my passes).I don't think you can. llvm-ld's always going to give you at least a verifier and TargetData pass. See tools/llvm-ld/Optimize.cpp for the details. If you pass --disable-opt it will put yours first, but then you're responsible for doing the things that llvm-ld normally does.> > Omitting AnalysisUsage::setPreservesAll() doesn't help and there is no > AnalysisUsage::invalidateAll(). Does anybody know a workaround?--disable-opt or change Optimize.cpp :) Reid.
Hi, Op 18-sep-06, om 21:34 heeft Reid Spencer het volgende geschreven:> I don't think you can. llvm-ld's always going to give you at least a > verifier and TargetData pass.Those passes don't hurt ...> See tools/llvm-ld/Optimize.cpp for the > details. If you pass --disable-opt it will put yours first, but then > you're responsible for doing the things that llvm-ld normally does.... so this approach did the trick for me. Thanks (also to Chris), Bram Adams GH-SEL, INTEC, Ghent University (Belgium)