[llvm-commits] [polly] r143692 - /polly/trunk/lib/Analysis/ScopDetection.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Wed Nov 16 05:15:57 PST 2011
On 11/16/2011 05:55 AM, Sebastian Pop wrote:
> On Fri, Nov 4, 2011 at 5:08 AM, Tobias Grosser
> <grosser at fim.uni-passau.de> wrote:
>> Author: grosser
>> Date: Fri Nov 4 05:08:08 2011
>> New Revision: 143692
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=143692&view=rev
>> Log:
>> ScopDetection: Small fixes and improvements for the SCEVValidator
>>
>> These fixes were part of a code audit of the SCEVValidator.
>>
>> Modified:
>> polly/trunk/lib/Analysis/ScopDetection.cpp
>>
>> Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
>> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=143692&r1=143691&r2=143692&view=diff
>> ==============================================================================
>> --- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
>> +++ polly/trunk/lib/Analysis/ScopDetection.cpp Fri Nov 4 05:08:08 2011
>> SCEVType::TYPE visitUDivExpr(const SCEVUDivExpr* Expr) {
>> - // We do not yet support unsigned operations.
>> + SCEVType::TYPE LHS = visit(Expr->getLHS());
>> + SCEVType::TYPE RHS = visit(Expr->getRHS());
>> +
>> + // We currently do not represent a unsigned devision as an affine
>
> s/a unsigned/an unsigned/
Fixed in current.
>> - if (Start == SCEVType::INVALID)
>> - return Start;
>> + if (Start == SCEVType::INVALID ||
>> + Recurrence == SCEVType::INVALID ||
>> + Recurrence == SCEVType::IV)
>> + return SCEVType::INVALID;
>> +
>> + if (!R->contains(Expr->getLoop())) {
>> + if (Start == SCEVType::IV)
>> + return SCEVType::INVALID;
>> + else
>> + return SCEVType::PARAM;
>> + }
>>
>> - SCEVType::TYPE Recurrence = visit(Expr->getStepRecurrence(SE));
>> if (Recurrence != SCEVType::INT)
>> return SCEVType::INVALID;
>>
>> - return SCEVType::PARAM;
>> + return SCEVType::IV;
>
> Good!
> I see that you got this one corrected.
>
>> }
>> SCEVType::TYPE visitUMaxExpr(const SCEVUMaxExpr* Expr) {
>> - // We do not yet support unsigned operations. If 'Expr' is constant
>> - // during Scop execution treat this as a parameter, otherwise bail out.
>> + // We do not support unsigned operations. If 'Expr' is constant during Scop
>> + // execution we treat this as a parameter, otherwise we bail out.
>> for (int i = 0, e = Expr->getNumOperands(); i< e; ++i) {
>> SCEVType::TYPE OpType = visit(Expr->getOperand(i));
>>
>> if (OpType != SCEVType::INT&& OpType != SCEVType::PARAM)
>> - return SCEVType::PARAM;
>> + return SCEVType::INVALID;
>
> And this one as well looks good after this change.
I should do the review before committing. Sorry committing incomplete stuff.
Tobi
More information about the llvm-commits
mailing list