[llvm-dev] sinking in LICM

via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 10 12:32:49 PDT 2017


On 2017-08-10 14:55, Friedman, Eli wrote:
> On 8/10/2017 11:34 AM, via llvm-dev wrote:
>> Hi,
>> 
>> In the IR below, %tmp.7 and %tmp.8 are not used in loop, so we can 
>> sink them in exit blocks. However, LICM do not handle this case 
>> because of the check in isNotUsedInLoop() which returns false when a 
>> PHI node use is hooked from a block inside the loop. I'm not sure if 
>> we really need to have this check even when the PHI is outside the 
>> loop?
>> 
>> Is there any problem I'm missing if we convert the above IR to the IR 
>> below :
>> 
> 
> I can't see any problem, except that we don't have code to split a
> loop exit like that.


Yes, we should add code to split the loop exit to support such cases. 
Before that I wanted to understand why we currently have such check for 
PHI uses in isNotUsedInLoop()? Is this a bug? or is there a case we need 
to consider?


> 
> -Eli


-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a 
Linux Foundation Collaborative Project.


More information about the llvm-dev mailing list