Displaying 4 results from an estimated 4 matches for "getnumiterationsinrange".
2008 Nov 12
1
[LLVMdev] Possible bug in ScalarEvolution
Hi,
I'm using pass ScalarEvolution to analyze the loop trip count on my
application.
And I found a possible bug in the code, that is in function
SCEVAddRecExpr::getNumIterationsInRange(),
Line 2905:
2904 // The exit value should be (End+A)/A.
2905 APInt ExitVal = (End + A).udiv(A);
2906 ConstantInt *ExitValue = ConstantInt::get(ExitVal);
The divide should be sdiv, right? otherwise, the ExitVal will be zero when A
= -1
For example, for (int i = 15; i > 7; --i)...
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
...mp slt i32 %tmp13, 0 ; <i1> [#uses=1]
pass indvars should transform it into a canonical exit condtion EQ or NE,
but as scalarevolution returned NonComputedItCount, it failed to do that.
In pass ScalarEvolution three algorithms failed to compute the trip count:
1. In SCEVAddRecExpr::getNumIterationsInRange(), as the loop stride is
negative, the exit value expression will be zero: (Here A is the stride
value)
// The exit value should be (End+A)/A.
APInt ExitVal = (End + A).udiv(A);
ConstantInt *ExitValue = ConstantInt::get(ExitVal);
2. In Line 1953, the switch-case computes the...
2013 Jul 11
1
[LLVMdev] Scalar Evolution and Loop Trip Count.
...nc = getelementptr i32* %arrayidx5.phi, i32 1
--> {(4 + %a),+,4}<%for.body> Exits: (1020 + %a)
Determining loop execution counts for: @add
Loop %for.body: backedge-taken count is -2
Loop %for.body: max backedge-taken count is -2
The problem seems to be in SCEVAddRecExpr:getNumIterationsInRange,
specifically
// If this is an affine expression then we have this situation:
// Solve {0,+,A} in Range === Ax in Range
// We know that zero is in the range. If A is positive then we
know that
// the upper value of the range must be the first possible exit
value....
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
...into a canonical exit condtion EQ or
>> > NE, but as scalarevolution returned NonComputedItCount, it failed to do
>> > that.
>> >
>> > In pass ScalarEvolution three algorithms failed to compute the trip count:
>> >
>> > 1. In SCEVAddRecExpr::getNumIterationsInRange(), as the loop stride is
>> > negative, the exit value expression will be zero: (Here A is the stride
>> > value)
>> >
>> > // The exit value should be (End+A)/A.
>> > APInt ExitVal = (End + A).udiv(A);
>> > ConstantInt *E...