search for: optimizationlevel

Displaying 19 results from an estimated 19 matches for "optimizationlevel".

2017 Jan 05
4
LLVMTargetMachine with optimization level passed from clang.
I see the BackendUtil.cpp of Clang creates the TargetMachine with the optimization level based on below mentioned logic CodeGenOpt::Level OptLevel = CodeGenOpt::Default; switch (CodeGenOpts.OptimizationLevel) { default: break; case 0: OptLevel = CodeGenOpt::None; break; case 3: OptLevel = CodeGenOpt::Aggressive; break; } As per my understanding, the correspondence between optimization level and CodeGenOpt is as below O0 - none O1 - less O2 - default O3 - aggressive My go...
2013 May 08
0
[LLVMdev] CommandLine: using cl::Positional with enum
...read due to its lack of new lines. > > I don't think the designer of the CommandLine library ever intended for > cl::Positional to be used with cl::opt<T> where T is an enum. > > e.g. > > enum OptLevel { > g, O1, O2, O3 > }; > > cl::opt<OptLevel> OptimizationLevel(cl::desc("Choose optimization level:"), > cl::values( > clEnumVal(g , "No optimizations, enable debugging"), > clEnumVal(O1, "Enable trivial optimizations"), > clEnumVal(O2, "Enable default optimizations"), > clEnumVal(O3, "Enable expensiv...
2013 May 10
0
[LLVMdev] CommandLine: using cl::Positional with enum
...read due to its lack of new lines. > > I don't think the designer of the CommandLine library ever intended for > cl::Positional to be used with cl::opt<T> where T is an enum. > > e.g. > > enum OptLevel { > g, O1, O2, O3 > }; > > cl::opt<OptLevel> OptimizationLevel(cl::desc("Choose optimization level:"), > cl::values( > clEnumVal(g , "No optimizations, enable debugging"), > clEnumVal(O1, "Enable trivial optimizations"), > clEnumVal(O2, "Enable default optimizations"), > clEnumVal(O3, "Enable expensiv...
2018 Aug 21
2
Function optimization pass
...;> } >> >> auto pass_builder = llvm::PassBuilder{}; >> auto fa_manager = llvm::FunctionAnalysisManager{}; >> >> pass_builder.registerFunctionAnalyses(fa_manager); >> auto fp_manager = >> pass_builder.buildFunctionSimplificationPipeline(llvm::PassBuilder::OptimizationLevel::O2); >> >> fp_manager.run(*lift_func, fa_manager); >> >> ...print mod... >> >> >> but the program crashes always at fp_manager.run. Strange enough, LLVM's >> opt tool (which uses legacy optimization API) works without any problem, >> i.e if...
2018 Jul 21
2
Registering passes on a module
...all, I'm trying to build passes with the PassBuilder to optimize the result of MCJIT (I assume, this is a requirement for performance). So I do this: llvm::PassBuilder passBuilder; llvm::ModulePassManager modulePassManager = passBuilder.buildPerModuleDefaultPipeline(llvm::PassBuilder::OptimizationLevel::O3); llvm::ModuleAnalysisManager moduleAnalysisManager; passBuilder.registerModuleAnalyses(moduleAnalysisManager); modulePassManager.run(*module, moduleAnalysisManager); with module being a pointer to an LLVM module. Unfortunately, the moduleAnalysisManager has only the module passes,...
2013 May 12
0
[LLVMdev] CommandLine: using cl::Positional with enum
...to read due to its lack of new lines. > > I don't think the designer of the CommandLine library ever intended for > cl::Positional to be used with cl::opt<T> where T is an enum. > > e.g. > > enum OptLevel { > g, O1, O2, O3 > }; > > cl::opt<OptLevel> OptimizationLevel(cl::desc("Choose optimization level:"), > cl::values( > clEnumVal(g , "No optimizations, enable debugging"), > clEnumVal(O1, "Enable trivial optimizations"), > clEnumVal(O2, "Enable default optimizations"), > clEnumVal(O3, "Enable expensiv...
2013 May 07
1
[LLVMdev] CommandLine: using cl::Positional with enum
Hi,I've been trying to code through CommandLine the options I want my tool accepts, but I find quite impossible to achieve robustly what I need .Look, I want the tool accepts a list of arguments in a particular order. For this goal, I know the cl::Positional flag. But, the problem is that the first argument must be one of a set of options (like a kind of subcommand of the tool). In my case,
2017 Jan 05
3
LLVMTargetMachine with optimization level passed from clang.
...ev >> <llvm-dev at lists.llvm.org> wrote: >> >> I see the BackendUtil.cpp of Clang creates the TargetMachine with >> the optimization level based on below mentioned logic >> >> CodeGenOpt::Level OptLevel = CodeGenOpt::Default; >> switch (CodeGenOpts.OptimizationLevel) { >> default: break; >> case 0: OptLevel = CodeGenOpt::None; break; >> case 3: OptLevel = CodeGenOpt::Aggressive; break; >> } >> >> As per my understanding, the correspondence between optimization >> level and CodeGenOpt is as below >> O0 - none &...
2013 May 14
0
[LLVMdev] CommandLine: using cl::Positional with enum
...>> I don't think the designer of the CommandLine library ever intended for >> cl::Positional to be used with cl::opt<T> where T is an enum. >> >> e.g. >> >> enum OptLevel { >> g, O1, O2, O3 >> }; >> >> cl::opt<OptLevel> OptimizationLevel(cl::desc("Choose optimization level:"), >> cl::values( >> clEnumVal(g , "No optimizations, enable debugging"), >> clEnumVal(O1, "Enable trivial optimizations"), >> clEnumVal(O2, "Enable default optimizations"), >> clEnumVal(O3, &...
2018 Aug 20
2
Function optimization pass
...<< "Error: cannot get function\n";     return 0; } auto pass_builder = llvm::PassBuilder{}; auto fa_manager = llvm::FunctionAnalysisManager{}; pass_builder.registerFunctionAnalyses(fa_manager); auto fp_manager = pass_builder.buildFunctionSimplificationPipeline(llvm::PassBuilder::OptimizationLevel::O2); fp_manager.run(*lift_func, fa_manager); ...print mod... but the program crashes always at fp_manager.run. Strange enough, LLVM's opt tool (which uses legacy optimization API) works without any problem, i.e if I run opt -O2 go_back.bc -o go_back_o2.bc then I get a new module where...
2016 Sep 09
2
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
..."LangOpts.C" on the next line. + if ( (LangOpts.C11 || LangOpts.C99 || LangOpts.CPlusPlus) // ... + /*...*/ && ( CodeGenOptions::FPC_On == Res.getCodeGenOpts().getFPContractMode() ) // ... // just being careful + /*...*/ && (Res.getCodeGenOpts().OptimizationLevel >= 3) ) + LangOpts.DefaultFPContract = 1; + return Success; } diff --git a/clang/test/CodeGen/fp-contract-pragma.cpp b/clang/test/CodeGen/fp-contract-pragma.cpp index 1c5921a..0949272 100644 --- a/clang/test/CodeGen/fp-contract-pragma.cpp +++ b/clang/test/CodeGen/fp-contract-pragma.cpp...
2017 Jan 06
2
LLVMTargetMachine with optimization level passed from clang.
...>>> <llvm-dev at lists.llvm.org> wrote: >>> I see the BackendUtil.cpp of Clang creates the TargetMachine with >>> the optimization level based on below mentioned logic >>> CodeGenOpt::Level OptLevel = CodeGenOpt::Default; switch >>> (CodeGenOpts.OptimizationLevel) { >>> default: break; >>> case 0: OptLevel = CodeGenOpt::None; break; case 3: OptLevel = >>> CodeGenOpt::Aggressive; break; } As per my understanding, the >>> correspondence between optimization level and CodeGenOpt is as below >>> O0 - none >&gt...
2017 Jan 06
3
LLVMTargetMachine with optimization level passed from clang.
...;llvm-dev at lists.llvm.org> wrote: >>>> I see the BackendUtil.cpp of Clang creates the TargetMachine with >>>> the optimization level based on below mentioned logic >>>> CodeGenOpt::Level OptLevel = CodeGenOpt::Default; switch >>>> (CodeGenOpts.OptimizationLevel) { >>>> default: break; >>>> case 0: OptLevel = CodeGenOpt::None; break; case 3: OptLevel = >>>> CodeGenOpt::Aggressive; break; } As per my understanding, the >>>> correspondence between optimization level and CodeGenOpt is as below >>>>...
2011 Nov 22
2
[LLVMdev] Instrumentation passes and -O0 optimization level
...ecific extension points.However all of theextensions if the -O0 flag is added to the command line; as thecomment says, "If all optimizations are disabled, just run thealways-inline pass."This doesn't play well with _instrumentation_passes which should not be disabled regardless of the optimizationlevel. My proposal is to add a specific extension point to preserve a passeven if O0 is used (below is the usage example with theAddressSanitizer pass)Another solution would be to introduce a passattribute which tells whether the pass should be preserved if theoptimizations are disabled, but this will r...
2016 Sep 09
3
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
...uess: b/c we don`t want programs to give different results when compiled at different "-O<...>" settings with the exception of "-Ofast". At any rate, the above change is trivial to apply to my recent proposed patch: just remove the "&& (Res.getCodeGenOpts().OptimizationLevel >= 3)" part of the condition. Regards, Abe
2017 Jan 06
2
LLVMTargetMachine with optimization level passed from clang.
...rote: > >>>>> I see the BackendUtil.cpp of Clang creates the TargetMachine with > >>>>> the optimization level based on below mentioned logic > >>>>> CodeGenOpt::Level OptLevel = CodeGenOpt::Default; switch > >>>>> (CodeGenOpts.OptimizationLevel) { > >>>>> default: break; > >>>>> case 0: OptLevel = CodeGenOpt::None; break; case 3: OptLevel = > >>>>> CodeGenOpt::Aggressive; break; } As per my understanding, the > >>>>> correspondence between optimization level and CodeG...
2006 Aug 20
0
[LLVMdev] Weird behavior of llvm-ld
...> +// Pass Name Options (cf. opt) > + > +static cl::list<const PassInfo*, bool, > + FilteredPassNameParser<PassInfo::Optimization> > > +OptimizationList(cl::desc("Optimizations available:")); > + > // Optimization Options > > enum OptimizationLevels { > @@ -72,9 +80,10 @@ > cl::aliasopt(DisableInternalize), > cl::desc("Alias for -disable-internalize")); > > -static cl::list<std::string> LoadableModules("load", > +//disambiguate with -load option from llvm/Support/PluginLoader.h > +/*stati...
2006 Aug 18
2
[LLVMdev] Weird behavior of llvm-ld
Hi, Reid Spencer wrote: >> That's interesting! So, one only needs to add a 2-arg function called >> RunOptimizations to the module (can't check it right now)? >> > > That is correct. That function and only that function will be called. > What happens in that function is up to you :) > So, I tried this the last two days, but to no avail. I first
2017 Mar 12
3
Distributing llc and opt with own package?
Hi Matthias, what I’m observing right now is that replacing opt+llc with an clang invocation, and subsequently fewer intermediate files, increases the consumed time with -O0 by 200%. We used to always run opt with -mem2reg -globalopt, and I believe those are not part of -O0 (is there an easy way to list all passes that -OX flags to clang imply for the optimizer and code gen?). Could the IR imply