Duncan Sands
2008-Apr-16 20:02 UTC
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
Hi Devang,> 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 > 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.
Devang Patel
2008-Apr-16 20:09 UTC
[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
On Apr 16, 2008, at 1:02 PM, Duncan Sands wrote:> Hi Devang, > >> 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 >> 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 :)IMO, we should avoid using flag_unit_at_a_time here. - Devang
Duncan Sands
2008-Apr-17 09:26 UTC
[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 thought I understood why but it seems that I don't :) > > IMO, we should avoid using flag_unit_at_a_time here.given DannyB's explanation that this flag exists in gcc so that glibc works properly in spite of abusing ASM, perhaps this logic in llvm-backend also exists to ensure that glibc works? Ciao, Duncan.
Possibly Parallel Threads
- [LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
- [LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
- [LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
- [LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc
- [LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc