[LLVMdev] LiveVariables/LiveInterval on huge functions

Török Edwin edwintorok at gmail.com
Mon Apr 14 02:23:37 PDT 2008


Török Edwin wrote:
> Evan Cheng wrote:
>   
>> On Apr 13, 2008, at 1:28 PM, Török Edwin wrote:
>>
>>   
>>     
>>> Hi,
>>>
>>> In PR2193 LiveVariables runs out of memory on a 512M limit, after
>>> processing 11557 basicblocks.
>>> VirtRegInfo has ~180000 entries with ~700 bytes each.
>>> If I give it more memory (1.5G) it runs out of memory in LiveInterval.
>>>     
>>>       
>> Some of the information kept by LiveVariables are somewhat redundant  
>> and can be removed. I think there was talk of folding much of its  
>> computation into LiveIntervalAnalysis. It's not clear whether that  
>> would make a difference without careful analysis.
>>
>> It's not clear to me what to do about LiveInterval. It does keep a lot  
>> of information but it's all essential.
>>
>> I suspect StrongPHIElimination may help the situation somewhat but  
>> again I can't guess its impact.
>>
>>   
>>     
>
> Another question to ask, is why that function became so large in the
> first place [X86DAGToDAGISel::SelectCode(llvm::SDOperand)]
> We have inline limits, don't we?

most of functions called by SelectCode get a -30000 cost reduction
because they are internal.
Even if Caller.size() is 40000, the penalty is only 2000, thus we still
have negative costs.

Removing the /20 factor from here improves the situation a lot, however
I think there is  a reason for /20, and it can't be just removed:
InlineCost += Caller->size()/20;


Best regards,
--Edwin





More information about the llvm-dev mailing list