[LLVMdev] flag_unit_at_a_time and pass scheduling in llvm-gcc

Török Edwin edwintorok at gmail.com
Thu Apr 17 08:15:53 PDT 2008


Duncan Sands wrote:
> 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?

Would changing handling of flag_unit_at_a_time solve PR2143, and allow
glibc to be compiled by llvm-gcc?

Best regards,
--Edwin



More information about the llvm-dev mailing list