On Mar 15, 2009, at 7:55 AM, Nyx wrote:> > Is there a webpage documenting these function passes?Here's some: http://llvm.org/docs/WritingAnLLVMPass.html#FunctionPass You can also look in llvm/lib/Transforms/Scalar for runOnFunction ()> Which ones should I run > to maximize performance?There's no right way to determine this. It depends on what you need/ want from your code.> Also, do the machine function passes automatically > run (I'm assuming those optimize the final x86 code).Yes. Don't forget to add the target data pass. -eric
This is what I have so far: // Add optimization passes to the function passes s_pFunctionPasses->add(new llvm::TargetData(s_pModule)); s_pFunctionPasses->add(llvm::createCFGSimplificationPass()); s_pFunctionPasses->add(llvm::createPromoteMemoryToRegisterPass()); s_pFunctionPasses->add(llvm::createConstantPropagationPass()); s_pFunctionPasses->add(llvm::createDeadCodeEliminationPass()); s_pFunctionPasses->add(llvm::createInstructionCombiningPass()); Where s_pFunctionPasses is a FunctionPassManager I create when initializing my program and delete at shutdown. I'm running the CFG simplification one first in the hope that it will speed up the passes that follow it. Just to make sure I understand: I shouldn't add x86 optimization passes myself, LLVM will take care of running the appropriate ones for me, is that correct? If it's incorrect, how do I manage those passes? - Maxime Eric Christopher-2 wrote:> > > On Mar 15, 2009, at 7:55 AM, Nyx wrote: > >> >> Is there a webpage documenting these function passes? > > Here's some: > > http://llvm.org/docs/WritingAnLLVMPass.html#FunctionPass > > You can also look in llvm/lib/Transforms/Scalar for runOnFunction () > >> Which ones should I run >> to maximize performance? > > There's no right way to determine this. It depends on what you need/ > want from your code. > >> Also, do the machine function passes automatically >> run (I'm assuming those optimize the final x86 code). > > Yes. Don't forget to add the target data pass. > > -eric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- View this message in context: http://www.nabble.com/Strange-LLVM-Crash-tp22508882p22530642.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
On Mar 15, 2009, at 6:31 PM, Nyx wrote:> > This is what I have so far: > > // Add optimization passes to the function passes > s_pFunctionPasses->add(new llvm::TargetData(s_pModule)); > s_pFunctionPasses->add(llvm::createCFGSimplificationPass()); > s_pFunctionPasses->add(llvm::createPromoteMemoryToRegisterPass()); > s_pFunctionPasses->add(llvm::createConstantPropagationPass()); > s_pFunctionPasses->add(llvm::createDeadCodeEliminationPass()); > s_pFunctionPasses->add(llvm::createInstructionCombiningPass()); > > Where s_pFunctionPasses is a FunctionPassManager I create when > initializing > my program and delete at shutdown. I'm running the CFG > simplification one > first in the hope that it will speed up the passes that follow it. >I'd swap it and mem2reg, but otherwise it looks ok. You can also add GVN if you can spare the time.> Just to make sure I understand: I shouldn't add x86 optimization > passes > myself, LLVM will take care of running the appropriate ones for me, > is that > correct? If it's incorrect, how do I manage those passes?Unless you have some x86 specific machine code pass that you wrote and need to run, then no, you don't need to worry about it. getPointerToFunction() should handle all of that. -eric