search for: populatefunctionpassmanager

Displaying 20 results from an estimated 52 matches for "populatefunctionpassmanager".

2015 Dec 20
3
How to run InternalizePass
...;t seem to do anything. Here's what I have so far: legacy::FunctionPassManager FPM(&M); legacy::PassManager MPM; PassManagerBuilder Builder; Builder.OptLevel = 3; Builder.PrepareForLTO = true; Builder.VerifyInput = true; Builder.VerifyOutput = true; Builder.populateFunctionPassManager(FPM); Builder.populateModulePassManager(MPM); FPM.doInitialization(); for (Function &F : M) FPM.run(F); FPM.doFinalization(); MPM.run(M); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attac...
2020 Apr 04
2
Running opt O1 outside of llvm
...n someone please help me find what I am missing? Thanks, Akash. * PassManagerBuilder PM; PM.OptLevel = 1; PM.SizeLevel = 0; legacy::FunctionPassManager FPM(&llvm_module); legacy::PassManager MPM; PM.Inliner = createAlwaysInlinerLegacyPass(); PM.DisableUnrollLoops = true; PM.populateFunctionPassManager(FPM); PM.populateModulePassManager(MPM); FPM.doInitialization(); for (auto &F : llvm_module) FPM.run(F); FPM.doFinalization(); MPM.run(llvm_module); legacy::FunctionPassManager FPM(&llvm_module); FPM.add(createDemoteRegisterToMemoryPass()); FPM.doInitialization(); for (auto &F : llvm...
2018 Jul 10
2
Programmatically Toggle Specific LLVM Optimizations
...n't expect to work straight out of the box) > > This is not strictly the same as optimizing using clang (pass options > are missing), so there will be performance differences. You could > instead customize PassManagerBuilder::populateModulePassManager() and > PassManagerBuilder::populateFunctionPassManager(). > > Michael
2017 Apr 10
3
Relationship between clang, opt and llc
...opt -O3 source.bc -o source.bc llc -O3 -filetype=obj source.bc -o source.o ... clang a.o b.o c.o ... -o executable I took a look at the source code of the clang tool and the opt tool, they both seem to use the PassManagerBuilder::populateModulePassManager() and PassManagerBuilder::populateFunctionPassManager() functions to add passes to their optimization pipeline; and for the backend, the clang and llc both use the addPassesToEmitFile() function to generate object code. So presumably the above two approaches to generating optimized executable file should do the same thing. However, I am seeing that t...
2013 Nov 07
1
[LLVMdev] SLP vectorizer turned on in commit r190916 which says nothing about it - how to turn it off?
...===== --- tools/opt/opt.cpp (revision 190915) +++ tools/opt/opt.cpp (revision 190916) @@ -462,6 +462,7 @@ DisableLoopUnrolling : OptLevel == 0; Builder.LoopVectorize = OptLevel > 1 && SizeLevel < 2; + Builder.SLPVectorize = true; Builder.populateFunctionPassManager(FPM); Builder.populateModulePassManager(MPM); I think that should not be there? There should at least be a way to turn the SLP optimizer off? It breaks things on our architecture(TCE) which I'm now porting to use llvm 3.4
2018 Jun 01
2
Programmatically Toggle Specific LLVM Optimizations
Hi everyone! First time poster here. Apologies if I am breaking some rules and please let me know so I will not break it again! I am a summer research student at the Computer Science Department at the University of Toronto and I am working on benchmarking LLVM optimizations. I tried looking for it online but was not able to find a programmatic way to toggle specific LLVM optimizations. For
2018 Nov 16
2
Help with a pass
Hi all, I was able to create a pass following [1]. Now goal is amend the pass and try to dump the call graph. I think I have properly amended the source extending my pass from CallGraphSCCPass but unfortunately every time I run it, it crashes. I tried with llvm-6 and llvm-7. I notice that if I change EP_EarlyAsPossible to anything else it does not crash but I don't see the expected string
2018 Jun 12
2
ModulePass cannot be registered as EarlyAsPossible
Hello all, I've followed the example in https://github.com/CompilerTeaching/SimplePass/blob/master/SimplePass.cc in order to create a custom pass. The pass needs to be added before any transformation, so I used EP_EarlyAsPossible extension point to register it. Furthermore, I need to access to every GlobalVariable in the IR, so my pass has to be a ModulePass, like this: struct MyPass :
2017 Apr 11
2
Relationship between clang, opt and llc
...source.bc > llc -O3 -filetype=obj source.bc -o source.o > ... > clang a.o b.o c.o ... -o executable > > I took a look at the source code of the clang tool and the opt tool, they both seem to use the PassManagerBuilder::populateModulePassManager() and PassManagerBuilder::populateFunctionPassManager() functions to add passes to their optimization pipeline; and for the backend, the clang and llc both use the addPassesToEmitFile() function to generate object code. > > So presumably the above two approaches to generating optimized executable file should do the same thing. However, I am see...
2016 May 09
2
Some questions about phase ordering in OPT and LLC
...xtern -globaldce -constmerge -verify > > > > Why are there two "Pass Arguments"? > > What does it mean? > > > There are two PassManager instantiated and ran on the IR. I am not aware of a good reason for that (the first one is created with PassManagerBuilder::populateFunctionPassManager() and the second one with PassManagerBuilder::populateModulePassManager()). > > You can look at AddOptimizationPasses() in opt.cpp. As far as I understand, the two passmanager do not interleave their passes. It first runs all the function passes and below. Then all the module passes. So if...
2017 Apr 11
3
Relationship between clang, opt and llc
...type=obj source.bc -o source.o >> ... >> clang a.o b.o c.o ... -o executable >> >> I took a look at the source code of the clang tool and the opt tool, they >> both seem to use the PassManagerBuilder::populateModulePassManager() and >> PassManagerBuilder::populateFunctionPassManager() functions to add >> passes to their optimization pipeline; and for the backend, the clang and >> llc both use the addPassesToEmitFile() function to generate object code. >> >> So presumably the above two approaches to generating optimized executable >> file should do...
2019 May 13
2
Is it possible to reproduce the result of opt -O3 manually?
...enForced) { return new LoopVectorize(InterleaveOnlyWhenForced, VectorizeOnlyWhenForced); } When we give pass names, opt calls the default constructor (eg: LoopVectorize()) whereas when we give O3, it can call a different version. You can check in PassManagerBuilder.cpp (populateModulePassManager, populateFunctionPassManager) to see where different versions are being populated. Those must be the points in the pipeline where the IR starts differing. On Sat, May 11, 2019 at 10:09 PM Mehdi AMINI via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi, > > On Thu, May 9, 2019 at 5:20 PM Rahim Mammadli via l...
2018 Jan 05
0
Relationship between clang, opt and llc
...urce.o >>> ... >>> clang a.o b.o c.o ... -o executable >>> >>> I took a look at the source code of the clang tool and the opt tool, >>> they both seem to use the PassManagerBuilder::populateModulePassManager() >>> and PassManagerBuilder::populateFunctionPassManager() functions to add >>> passes to their optimization pipeline; and for the backend, the clang and >>> llc both use the addPassesToEmitFile() function to generate object code. >>> >>> So presumably the above two approaches to generating optimized >>> execu...
2018 Jan 05
2
Relationship between clang, opt and llc
...... >>>> clang a.o b.o c.o ... -o executable >>>> >>>> I took a look at the source code of the clang tool and the opt tool, >>>> they both seem to use the PassManagerBuilder::populateModulePassManager() >>>> and PassManagerBuilder::populateFunctionPassManager() functions to add >>>> passes to their optimization pipeline; and for the backend, the clang and >>>> llc both use the addPassesToEmitFile() function to generate object code. >>>> >>>> So presumably the above two approaches to generating optimized &g...
2012 Mar 23
0
[LLVMdev] Execution Engine: CodeGenOpt level
...lder.DisableSimplifyLibCalls = !conf.is_set(CF_SIMPLIB); if (Opt != CodeGenOpt::None) { PMBuilder.Inliner = createFunctionInliningPass(Opt == CodeGenOpt::Aggressive ? 250 : 200); } pFPasses = new FunctionPassManager(pMod); pFPasses->add(new TargetData(*TD)); PMBuilder.populateFunctionPassManager(*pFPasses); pFPasses->doInitialization(); pFPasses->run(*pFun); pFPasses->doFinalization(); delete pFPasses; pMPasses = new PassManager(); pMPasses->add(new TargetData(*TD)); pMPasses->add(createCFGSimplificationPass()); pMPasses->add(createBlockPla...
2018 Jan 06
4
Relationship between clang, opt and llc
...ng a.o b.o c.o ... -o executable >>>>>> >>>>>> I took a look at the source code of the clang tool and the opt tool, >>>>>> they both seem to use the PassManagerBuilder::populateModulePassManager() >>>>>> and PassManagerBuilder::populateFunctionPassManager() functions to >>>>>> add passes to their optimization pipeline; and for the backend, the clang >>>>>> and llc both use the addPassesToEmitFile() function to generate object code. >>>>>> >>>>>> So presumably the above two appro...
2012 Mar 22
4
[LLVMdev] Execution Engine: CodeGenOpt level
Hi, How can I dynamically change the code generation optimization level (e.g., None) of a JIT in other to recompile a function with a new optimization level (e.g., Default)? Thank you. Best regards, Nurudeen.
2018 Jan 06
0
Relationship between clang, opt and llc
...>> clang a.o b.o c.o ... -o executable >>>>> >>>>> I took a look at the source code of the clang tool and the opt tool, >>>>> they both seem to use the PassManagerBuilder::populateModulePassManager() >>>>> and PassManagerBuilder::populateFunctionPassManager() functions to >>>>> add passes to their optimization pipeline; and for the backend, the clang >>>>> and llc both use the addPassesToEmitFile() function to generate object code. >>>>> >>>>> So presumably the above two approaches to generat...
2018 Jan 06
0
Relationship between clang, opt and llc
..... -o executable >>>>>>> >>>>>>> I took a look at the source code of the clang tool and the opt tool, >>>>>>> they both seem to use the PassManagerBuilder::populateModulePassManager() >>>>>>> and PassManagerBuilder::populateFunctionPassManager() functions to >>>>>>> add passes to their optimization pipeline; and for the backend, the clang >>>>>>> and llc both use the addPassesToEmitFile() function to generate object code. >>>>>>> >>>>>>> So presumably the...
2016 May 09
4
Some questions about phase ordering in OPT and LLC
Hi, I'm a PhD student doing phase ordering as part of my PhD topic and I would like to ask some questions about LLVM. Executing the following command to see what passes does OPT execute when targeting a SPARC V8 processor: /opt/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-15.10/bin/llvm-as < /dev/null | /opt/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-15.10/bin/opt -O3 -march=sparc -mcpu=v8