[llvm-commits] [llvm] r73401 - /llvm/trunk/lib/Analysis/IVUsers.cpp

Dan Gohman gohman at apple.com
Thu Jun 18 11:09:50 PDT 2009


On Jun 18, 2009, at 12:57 AM, Sanjiv Gupta wrote:


> Dan Gohman wrote:
>
>> Author: djg
>>
>> Date: Mon Jun 15 13:38:59 2009
>>
>> New Revision: 73401
>>
>>
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=73401&view=rev
>>
>> Log:
>>
>> Code cleanups. getSCEVAtScope no longer uses SCEVCouldNotCompute.
>>
>>
>>
>> Modified:
>>
>>    llvm/trunk/lib/Analysis/IVUsers.cpp
>>
>>
>>
>> Modified: llvm/trunk/lib/Analysis/IVUsers.cpp
>>
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=73401&r1=73400&r2=73401&view=diff
>>
>>
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>>
>> --- llvm/trunk/lib/Analysis/IVUsers.cpp (original)
>>
>> +++ llvm/trunk/lib/Analysis/IVUsers.cpp Mon Jun 15 13:38:59 2009
>>
>> @@ -120,9 +120,9 @@
>>
>>   // Use getSCEVAtScope to attempt to simplify other loops out of
>>
>>   // the picture.
>>
>>   SCEVHandle AddRecStart = AddRec->getStart();
>>
>> -  SCEVHandle BetterAddRecStart = SE->getSCEVAtScope(AddRecStart,  
>> UseLoop);
>>
>> -  if (!isa<SCEVCouldNotCompute>(BetterAddRecStart))
>>
>> -    AddRecStart = BetterAddRecStart;
>>
>> +  AddRecStart = SE->getSCEVAtScope(AddRecStart, UseLoop);
>>
>> +  SCEVHandle AddRecStride = AddRec->getStepRecurrence(*SE);
>>
>> +  AddRecStride = SE->getSCEVAtScope(AddRecStride, UseLoop);
>>
>>
>>
> Dan,
>
> Since you meant only code cleanup, the last line I think is left  
> there by mistake as in the original code we had only one call to
>
> SE->getSCEVAtScope(AddRecStart, UseLoop); which is already there two  
> lines above.

Hmm, you're right that this wasn't pure cleanup. This commit is a
change I had split out from a larger patch, and I missed that detail.
The call isn't redundant though; the first call is doing getSCEVAtScope
for the Start expression, and the second is doing it for the Stride
expression. This probably isn't especially valuable at the moment,
but it shouldn't cause trouble.

Dan




More information about the llvm-commits mailing list