search for: creategvnpass

Displaying 20 results from an estimated 49 matches for "creategvnpass".

2008 Dec 19
2
[LLVMdev] strange behaviour after extracting optimization pass code
...uot;; llvm::Module* mod = some arbitrary valid modulepointer; llvm::ExistingModuleProvider mp(mod); llvm::FunctionPassManager fpm(&mp); fpm.add(new llvm::TargetData(mod)); fpm.add(llvm::createInstructionCombiningPass()); fpm.add(llvm::createReassociatePass()); fpm.add(llvm::createGVNPass()); fpm.add(llvm::createCFGSimplificationPass()); fpm.run(*f); //...get execution engine //... call execEngine->getPointerToFunction() //... execute function ----------------------------- Now if I extract exactly this code and put it into a different method like follows, it pro...
2008 Aug 15
3
[LLVMdev] Problems understanding alias analysis validation logic
...alidated, it should be rerun before any other passes that requires it. Here is a simple example of the problem I am seeing: PassManager passManager; passManager.add(new TargetData(getTargetData())); passManager.add(createAndersensPass()); passManager.add(createIPSCCPPass()); passManager.add(createGVNPass()); <----will use BasicAA not Andersens ... In this case, I would expect that the GVN pass would use the andersen AA results, but it doesn't; it uses the results from a Basic AA pass. Reordering the passes like below fixes the problem, but I still don't understand why the andersens w...
2012 Sep 10
2
[LLVMdev] Dead Store Elimination
Hi, Here is the result of optimization using the following passes: llvm::createBasicAliasAnalysisPass() llvm::createInstructionCombiningPass() llvm::createReassociatePass() llvm::createGVNPass() llvm::createCFGSimplificationPass() The optimized IR seems to contain what look like dead stores on %8 and %9 in basic blocks 7 and haveData. How can I get rid of them? Thanks, Vinayak define internal void @block0() { entry: %0 = call i8* @RNI_File_new() %1 = call i64 @RNI_File_open(i8...
2010 Nov 15
6
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...w TargetData(*TheExecutionEngine->getTargetData())); // Do simple "peephole" optimizations and bit-twiddling optzns. OurFPM.add(createInstructionCombiningPass()); // Reassociate expressions. OurFPM.add(createReassociatePass()); // Eliminate Common SubExpressions. OurFPM.add(createGVNPass()); // Simplify the control flow graph (deleting unreachable blocks, etc). OurFPM.add(createCFGSimplificationPass()); It does simplify _some_ things. For example: ready> def simplifyThis(x) (x*2)+(2*x); Read function definition: define double @simplifyThis(double %x) readonly { entry: %m...
2015 Apr 19
2
[LLVMdev] remove redundant load by GVN() does not work
Hi, Assume I have the following code. The first four instructions in each BB does the same thing. So I think GVN() can remove the redundant code. However, after I apply GVN to my module by "Passes.add(createGVNPass())" and "Passes.run(*myModule)". It seems GVN does not remove the redundant instructions. Can anyone give me a hint what's going on here? Any hint is appreciable. ********************************************************************* cond_3:...
2011 Nov 04
2
[LLVMdev] Question on JIT optimizations
...for GVN. OurFPM.add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. OurFPM.add(createInstructionCombiningPass()); // Reassociate expressions. OurFPM.add(createReassociatePass()); // Eliminate Common SubExpressions. OurFPM.add(createGVNPass()); // Simplify the control flow graph (deleting unreachable blocks, etc). OurFPM.add(createCFGSimplificationPass()); OurFPM.doInitialization(); // Set the global so the code gen can use this. TheFPM = &OurFPM; // Run the main "interpreter loop" now. MainLoop(); -----...
2008 Dec 19
1
[LLVMdev] strange behaviour after extracting optimization pass code
...llvm::Module* mod = some arbitrary valid modulepointer; llvm::ExistingModuleProvider mp(mod); llvm::FunctionPassManager fpm(&mp); fpm.add(new llvm::TargetData(mod)); fpm.add(llvm::createInstructionCombiningPass()); fpm.add(llvm::createReassociatePass()); fpm.add(llvm::createGVNPass()); fpm.add(llvm::createCFGSimplificationPass()); fpm.run(*f); //...get execution engine //... call execEngine->getPointerToFunction() //... execute function ----------------------------- Now if I extract exactly this code and put it into a different method like follows, i...
2011 May 18
1
[LLVMdev] optimizing access to global
Hi! I'd like to optimize access to a global (write after read), but I didn't get it to work. I used: passManager.add(llvm::createGlobalsModRefPass()); passManager.add(llvm::createGVNPass()); Are these passes correct to do it? And my global is @global = internal global %0, align 16 I have for example int a = global.a.b[0]; global.a.b[0] = a; // this should be removed Does anybody have a hint? It's still llvm 2.8 Maybe the array access is the cause but all indexes are constan...
2012 Sep 10
0
[LLVMdev] Dead Store Elimination
Hi Vinayak, > Here is the result of optimization using the following passes: > > llvm::createBasicAliasAnalysisPass() > llvm::createInstructionCombiningPass() > llvm::createReassociatePass() > llvm::createGVNPass() > llvm::createCFGSimplificationPass() > you should run the mem2reg pass too, and first. > ; <label>:7 ; preds = %openSuccessBB > %8 = alloca i64, align 8 Put alloca instructions in the entry block if possible. Ciao, Duncan.
2015 Nov 06
2
Repeated application of optimization passes
Within the LLVM pass manager infrastructure, suppose we have two transformation passes, pass A makes some improvements, then pass B does likewise, but this creates opportunities for pass A to create further improvements (e.g. suppose B was function inlining) so it's desirable to run A again. How does the LLVM pass manager currently deal with this? -------------- next part -------------- An
2013 Jan 29
0
[LLVMdev] Running a Local Buildbot
...rror() <<"Failed to load module from bitcode file: " <<err_str <<endl; exit(1); } pm = new PassManager(); pm->add(createAlwaysInlinerPass()); fpm = new FunctionPassManager(module); fpm->add(new TargetData(module)); fpm->add(createGVNPass()); fpm->add(createInstructionCombiningPass()); fpm->add(createDeadCodeEliminationPass()); fpm->add(createCFGSimplificationPass()); fpm->add(createDeadStoreEliminationPass()); InitializeNativeTarget(); atexit(llvm_shutdown); EngineBuilder builder(modu...
2008 Dec 19
0
[LLVMdev] strange behaviour after extracting optimization pass code
...me arbitrary valid modulepointer; { > > llvm::ExistingModuleProvider mp(mod); > llvm::FunctionPassManager fpm(&mp); > fpm.add(new llvm::TargetData(mod)); > fpm.add(llvm::createInstructionCombiningPass()); > fpm.add(llvm::createReassociatePass()); > fpm.add(llvm::createGVNPass()); > fpm.add(llvm::createCFGSimplificationPass()); > fpm.run(*f); } > //...get execution engine > //... call execEngine->getPointerToFunction() > //... execute function
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...;getTargetData())); > // Do simple "peephole" optimizations and bit-twiddling optzns. > OurFPM.add(createInstructionCombiningPass()); > // Reassociate expressions. > OurFPM.add(createReassociatePass()); > // Eliminate Common SubExpressions. > OurFPM.add(createGVNPass()); > // Simplify the control flow graph (deleting unreachable blocks, etc). > OurFPM.add(createCFGSimplificationPass()); > > It does simplify _some_ things. For example: > > ready> def simplifyThis(x) (x*2)+(2*x); > Read function definition: > define double @simpl...
2010 Nov 15
1
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...luck after switching to: theFPM->add( new llvm::TargetData( *theExecutionEngine->getTargetData() ) ); theFPM->add( llvm::createBasicAliasAnalysisPass() ); theFPM->add( llvm::createInstructionCombiningPass() ); theFPM->add( llvm::createReassociatePass() ); theFPM->add( llvm::createGVNPass() ); theFPM->add( llvm::createCFGSimplificationPass() ); Based on output from "llvm-ld -version" and "clang -v" I'm using: llvm version 2.9svn clang version 2.9 (trunk 118171) > -----Original Message----- > From: Duncan Sands [mailto:baldrick at free.fr] &...
2011 Nov 04
0
[LLVMdev] Question on JIT optimizations
...iasAnalysisPass()); > // Do simple"peephole" optimizations and bit-twiddling optzns. > OurFPM.add(createInstructionCombiningPass()); > // Reassociate expressions. > OurFPM.add(createReassociatePass()); > // Eliminate Common SubExpressions. > OurFPM.add(createGVNPass()); > // Simplify the control flow graph (deleting unreachable blocks, etc). > OurFPM.add(createCFGSimplificationPass()); > > OurFPM.doInitialization(); > > // Set the global so the code gen can use this. > TheFPM =&OurFPM; > > // Run the main"i...
2013 Mar 30
2
[LLVMdev] Missed optimisation opportunities?
...aLayout())); FunctionPasses->add(createBasicAliasAnalysisPass()); FunctionPasses->add(createPromoteMemoryToRegisterPass()); FunctionPasses->add(createInstructionCombiningPass()); FunctionPasses->add(createReassociatePass()); FunctionPasses->add(createGVNPass()); FunctionPasses->add(createCFGSimplificationPass()); Which does a pretty good job of cleaning up most of the messy & verbose code generated by my front end. I end up with the following bitcode; define x86_stdcallcc { i1, i32 } @fib({ i1, i32 } %arg_al_x) { entry: %"3_4&q...
2017 Dec 21
2
Pass ordering - GVN vs. loop optimizations
...Pass()); // Unroll small loops addExtensionsToPM(EP_LoopOptimizerEnd, MPM); // <GVN is now immediately after loop optimizatons if (OptLevel > 1) { MPM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds MPM.add(NewGVN ? createNewGVNPass() : createGVNPass(DisableGVNLoadPRE)); // Remove redundancies } This causes a problem, because GVN appears to be the only pass that can merge loads across basic blocks. This means that if a loop index only appears behind a pointer, LLVM will not be able to optimize out bounds checks depending on it. The "ca...
2013 Jan 28
7
[LLVMdev] Running a Local Buildbot
We're thinking about running our own buildbot against the upstream llvm and clang sources. I'm talking to our build folks and seeing what they can allow. Maybe we can contribute some build slaves to the osuosl buildbot but I'm not sure. If we do end up having to run our own buildbot, what's the best way to integrate that into the upstream web page and status notifier? Basically,
2012 Feb 20
1
[LLVMdev] ARM opcode format
...OurFPM.add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. OurFPM.add(createInstructionCombiningPass()); // Reassociate expressions. OurFPM.add(createReassociatePass()); // Eliminate Common SubExpressions. OurFPM.add(createGVNPass()); // Simplify the control flow graph (deleting unreachable blocks, etc). OurFPM.add(createCFGSimplificationPass()); // we run optimizations and return the pointer to the function OurFPM.doInitialization(); Function* currentF = mod.getFunction("execute"); OurFPM....
2013 Nov 01
2
[LLVMdev] loop vectorizer: this loop is not worth vectorizing
...t be happy, because this will again introduce 'rem' and 'div' in the index calculation. I am using these passes: functionPassManager->add(llvm::createBasicAliasAnalysisPass()); functionPassManager->add(llvm::createLICMPass()); functionPassManager->add(llvm::createGVNPass()); functionPassManager->add(llvm::createLoopVectorizePass()); functionPassManager->add(llvm::createInstructionCombiningPass()); functionPassManager->add(llvm::createEarlyCSEPass()); functionPassManager->add(llvm::createCFGSimplificationPass()); I am wondering, whether th...