search for: createglobaldcepass

Displaying 20 results from an estimated 34 matches for "createglobaldcepass".

2008 Apr 16
2
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
...t-at- > a-time is not meant to select optimization passes, though it may > influence selection. this flag is used quite a bit in llvm-backend.cpp, for example: if (flag_unit_at_a_time) { PM->add(createGlobalOptimizerPass()); // Optimize out global vars PM->add(createGlobalDCEPass()); // Remove unused fns and globs PM->add(createIPConstantPropagationPass()); // IP Constant Propagation PM->add(createDeadArgEliminationPass()); // Dead argument elimination } I thought I understood why but it seems that I don't :) Ciao, Duncan.
2009 Mar 14
0
[LLVMdev] Strange LLVM Crash
...e)); passManager.add(llvm::createLowerSetJmpPass()); passManager.add(llvm::createRaiseAllocationsPass()); passManager.add(llvm::createCFGSimplificationPass()); passManager.add(llvm::createPromoteMemoryToRegisterPass()); passManager.add(llvm::createGlobalOptimizerPass()); passManager.add(llvm::createGlobalDCEPass()); passManager.add(llvm::createFunctionInliningPass()); I would like to know either which pass does this (global optimizer maybe?) so I can disable it, or what flag I can set on my C++ function objects to keep them from being pruned out. -- View this message in context: http://www.nabble.com/St...
2009 Mar 14
3
[LLVMdev] Strange LLVM Crash
...; passManager.add(llvm::createRaiseAllocationsPass()); >>> passManager.add(llvm::createCFGSimplificationPass()); >>> passManager.add(llvm::createPromoteMemoryToRegisterPass()); >>> passManager.add(llvm::createGlobalOptimizerPass()); >>> passManager.add(llvm::createGlobalDCEPass()); >>> passManager.add(llvm::createFunctionInliningPass()); >>> >>> I would like to know either which pass does this (global optimizer >>> maybe?) >>> so I can disable it, or what flag I can set on my C++ function objects to >>> keep them from...
2015 Jun 04
3
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
...available_externally functions or globals (dllimported vftable) reference linkonce_odr functions (virtual destructor thunks), so a single pass to drop available_externally function bodies isn't as strong as adding a flag to GlobalDCE. Personally, I think the right approach is to add a bool to createGlobalDCEPass defaulting to true named something like IsAfterInlining. In most standard pass pipelines, GlobalDCE runs after inlining for obvious reasons, so the default makes sense. The special case is the LTO pass pipeline, where the code will be reloaded and reoptimized later. IMO it's natural to put the...
2008 Apr 17
4
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
Hi Devang, > > this flag is used quite a bit in llvm-backend.cpp, for example: > > > > if (flag_unit_at_a_time) { > > PM->add(createGlobalOptimizerPass()); // Optimize out > > global vars > > PM->add(createGlobalDCEPass()); // Remove unused > > fns and globs > > PM->add(createIPConstantPropagationPass()); // IP Constant > > Propagation > > PM->add(createDeadArgEliminationPass()); // Dead argument > > elimination > > } > > > > I...
2009 Mar 15
0
[LLVMdev] Strange LLVM Crash
...tion passes. If the global DCE one is enabled, it eliminates the native functions that were not yet used from the module. Then, if I try to compile other scripts that would use the functions that have been eliminated, I get a crash. >From the LLVM source code, I found the following comment: // createGlobalDCEPass - This transform is designed to eliminate unreachable // internal globals (functions or global variables) So I guess the optmization pass is doing exactly what it was meant to do. I disabled it for now since I don't want the native functions to get eliminated, and am currently not using any gl...
2009 Mar 14
2
[LLVMdev] Strange LLVM Crash
...m::createLowerSetJmpPass()); > passManager.add(llvm::createRaiseAllocationsPass()); > passManager.add(llvm::createCFGSimplificationPass()); > passManager.add(llvm::createPromoteMemoryToRegisterPass()); > passManager.add(llvm::createGlobalOptimizerPass()); > passManager.add(llvm::createGlobalDCEPass()); > passManager.add(llvm::createFunctionInliningPass()); > > I would like to know either which pass does this (global optimizer maybe?) > so I can disable it, or what flag I can set on my C++ function objects to > keep them from being pruned out.
2015 Jun 04
5
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
On Thu, Jun 4, 2015 at 3:58 PM, Duncan P. N. Exon Smith < dexonsmith at apple.com> wrote: > > > Personally, I think the right approach is to add a bool to > createGlobalDCEPass defaulting to true named something like > IsAfterInlining. In most standard pass pipelines, GlobalDCE runs after > inlining for obvious reasons, so the default makes sense. The special case > is the LTO pass pipeline, where the code will be reloaded and reoptimized > later. IMO it's...
2008 Apr 16
0
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
...select optimization passes, though it may >> influence selection. > > this flag is used quite a bit in llvm-backend.cpp, for example: > > if (flag_unit_at_a_time) { > PM->add(createGlobalOptimizerPass()); // Optimize out > global vars > PM->add(createGlobalDCEPass()); // Remove unused > fns and globs > PM->add(createIPConstantPropagationPass()); // IP Constant > Propagation > PM->add(createDeadArgEliminationPass()); // Dead argument > elimination > } > > I thought I understood why but it seems t...
2010 Mar 02
2
[LLVMdev] make SHARED_LIBRARY=1 broken?
...0x5e6): undefined reference to `llvm::createPruneEHPass()' opt.cpp:(.text+0x64d): undefined reference to `llvm::createArgumentPromotionPass(unsigned int)' opt.cpp:(.text+0x668): undefined reference to `llvm::createFunctionAttrsPass()' opt.cpp:(.text+0x688): undefined reference to `llvm::createGlobalDCEPass()' /home/src/llvm-trunk/llvm/tools/opt/Release/opt.o: In function `(anonymous namespace)::AddOptimizationPasses(llvm::PassManager&, llvm::FunctionPassManager&, unsigned int)': opt.cpp:(.text+0x6e7): undefined reference to `llvm::createFunctionInliningPass(int)' opt.cpp:(.text+0x...
2009 Mar 14
5
[LLVMdev] Strange LLVM Crash
I'm implementing a JIT and getting some strange crashes. I'm unsure exactly what's causing them, but it seems to occur when I call the getReturnType() method on some LLVM function objects. More precisely, I'm registering some native C++ functions as LLVM functions through the addGlobalMapping method of an execution engine object. I then keep a pointer to those LLVM function
2009 Mar 14
0
[LLVMdev] Strange LLVM Crash
...Pass()); >> passManager.add(llvm::createRaiseAllocationsPass()); >> passManager.add(llvm::createCFGSimplificationPass()); >> passManager.add(llvm::createPromoteMemoryToRegisterPass()); >> passManager.add(llvm::createGlobalOptimizerPass()); >> passManager.add(llvm::createGlobalDCEPass()); >> passManager.add(llvm::createFunctionInliningPass()); >> >> I would like to know either which pass does this (global optimizer >> maybe?) >> so I can disable it, or what flag I can set on my C++ function objects to >> keep them from being pruned out. >...
2010 Mar 02
0
[LLVMdev] make SHARED_LIBRARY=1 broken?
...ce to `llvm::createPruneEHPass()' > opt.cpp:(.text+0x64d): undefined reference to > `llvm::createArgumentPromotionPass(unsigned int)' > opt.cpp:(.text+0x668): undefined reference to > `llvm::createFunctionAttrsPass()' > opt.cpp:(.text+0x688): undefined reference to `llvm::createGlobalDCEPass()' > /home/src/llvm-trunk/llvm/tools/opt/Release/opt.o: In function `(anonymous > namespace)::AddOptimizationPasses(llvm::PassManager&, > llvm::FunctionPassManager&, unsigned int)': > opt.cpp:(.text+0x6e7): undefined reference to > `llvm::createFunctionInliningPass(in...
2013 Jan 08
1
[LLVMdev] LTO "bug" and Clang warnings
...PM.add(createDeadArgEliminationPass()); PM.add(createInstructionCombiningPass()); // Inline small functions if (RunInliner) PM.add(createFunctionInliningPass()); PM.add(createPruneEHPass()); // Remove dead EH info. if (RunInliner) PM.add(createGlobalOptimizerPass()); PM.add(createGlobalDCEPass()); // Remove dead functions. Then I looped over all LTO passes in the populateLTOPassManager() but adding them manually (incrementally, until I passed them all) didn't allow me to reproduce the error. I'll create a bugzilla for this, and the Clang warning. If Clang folks think it's w...
2011 Mar 03
0
[LLVMdev] How to write optimizer loop
I've written an optimization loop, with the following form: PassManager lpm; lpm.add(createLoopDeletionPass()); lpm.add(createSCCPPass()); lpm.add(createAggressiveDCEPass()); lpm.add(createGlobalOptimizerPass()); lpm.add(createGlobalDCEPass()); lpm.add(createDeadStoreEliminationPass()); lpm.add(createLoopDeletionPass()); lpm.add(createInstructionCombiningPass()); lpm.add(createCFGSimplificationPass()); const int maxit = 100; int it = 0; bool changed = true;...
2006 Sep 03
0
[LLVMdev] llvm-gcc4: Enable various optimizations at -O1/-O2
...odulePasses->add(createCFGSimplificationPass()); // Clean up disgusting code + PerModulePasses->add(createPromoteMemoryToRegisterPass());// Kill useless allocas + PerModulePasses->add(createGlobalOptimizerPass()); // Optimize out global vars + PerModulePasses->add(createGlobalDCEPass()); // Remove unused fns and globs + PerModulePasses->add(createIPConstantPropagationPass());// IP Constant Propagation + PerModulePasses->add(createDeadArgEliminationPass()); // Dead argument elimination + PerModulePasses->add(createInstructionCombiningPass());...
2006 Mar 16
0
[LLVMdev] Re: a linking problem of LLVM
...e option to disable selected optimizations. You can however do the following. All the optimizations (organized as passes in LLVM) run by gccld are in llvm/tools/gccld/GenerateCode.cpp If you want to disable a specific pass, comment out that line in the file and recompile. e.g. //addPass(Passes, createGlobalDCEPass()); disables the GlobalDCE optimization. Hope it helps Dinakar
2008 Apr 16
0
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
On Apr 15, 2008, at 11:49 PM, Duncan Sands wrote: > As far as I can see flag_unit_at_a_time > is used to control whether inter-procedural/whole-module passes are > scheduled. You can do inlining even when flag_unit_at_a_time is off. And one can enable unit-at-a-time without enabling any optimizations. The unit-at- a-time is not meant to select optimization passes, though it may
2012 Apr 21
0
[LLVMdev] Remove function from module
Михаил wrote: > How correctly remove function from module? > For example: > > int f1(int x) { > ... > a = f2(smth); > ... > } > int f2 (int y) { > ... > b = f1(smth); > ... > } > > I need delete from module both f1 and f2. They haven't uses in other > part of module, but I can't delete them with eraseFromParent, because > they are use each
2008 Apr 16
3
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
In llvm-backend.cpp I see: if (optimize > 1) { if (flag_inline_trees > 1) // respect -fno-inline-functions PM->add(createFunctionInliningPass()); // Inline small functions if (flag_unit_at_a_time && !lang_hooks.flag_no_builtin()) PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations if (optimize > 2)