[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc

Duncan Sands baldrick at free.fr
Wed Apr 16 13:02:49 PDT 2008


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.



More information about the llvm-dev mailing list