search for: getbackedgetakencount

Displaying 20 results from an estimated 25 matches for "getbackedgetakencount".

2020 Feb 05
3
IndVarSimplify: getBackedgeTakenCount and Release vs Assert
...9-08-01 03:16:08 Committer: Philip Reames <listmail at philipreames.com> 2019-08-01 03:16:08 Fix a release-only build warning triggered by rL367485 llvm-svn: 367499 [..] +#ifndef NDEBUG + // Used below for a consistency check only const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L); +#endif ----- It seems that the 'SE->getBackedgeTakenCount(L)' call has sideeffects.. Is that to be expected ? Is the correct solution then to always keep the call ? Thanks, Jeroen Dobbelaere
2010 Aug 12
2
[LLVMdev] Questions about trip count
...correctly. I would do this with opt by calling: opt -mem2reg -loopsimplify -indvars -scalar-evolution -analyze prog.ll At the end of the output the tripcount of every loop should be written. To get the trip count in your pass you should ask ScalarEvolution. ScalarEvolution *SE; Loop *L; SE->getBackedgeTakenCount(L); If you need help trying this please ask back. Cheers Tobi
2011 Nov 21
4
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...ssion > or if the analysis would be to complicated. I am currently > not sure if this may actually happen when calling getSCEV(), because > getSCEV() could just return a SCEVUnknown referencing the Value itself. > Maybe SCEVCouldNotCompute is just generated by functions like > SE->getBackedgeTakenCount()? > > In case you cannot generate a test case that yields to this, I don't think > there is a need to try more. Even without such a test case the patch should > be OK. > > Cheers > Tobi > Ok, thanks, I'll try other test cases to check if everything is ok, better be...
2010 Aug 14
0
[LLVMdev] Questions about trip count
...g: > > opt -mem2reg -loopsimplify -indvars -scalar-evolution -analyze prog.ll > > At the end of the output the tripcount of every loop should be written. > > To get the trip count in your pass you should ask ScalarEvolution. > > ScalarEvolution *SE; > Loop *L; > SE->getBackedgeTakenCount(L); > > If you need help trying this please ask back. > > Cheers > Tobi > Thanks Tobias. Your answer helped me a lot. Now I can get the trip count of the loop like this: #define DEBUG_TYPE "hello" #include "llvm/Pass.h" #include "llvm/Function.h" #...
2015 Oct 12
2
question about llvm partial unrolling/runtime unrolling
...the Partial* members, but the loop still doesn't unroll. The unrolling process hits this code in LoopUnrollRuntime.cpp // Only unroll loops with a computable trip count and the trip count needs // to be an int value (allowing a pointer type is a TODO item) const SCEV *BECountSC = SE->getBackedgeTakenCount(L); if (isa<SCEVCouldNotCompute>(BECountSC) || !BECountSC->getType()->isIntegerTy()) return false; BECountSC=0xcccccccc and returns false here. Based on the comments it looks like I still need a constant loop counter. Is there a way to unroll with non-constant loop counter...
2011 Nov 21
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...cannot analyze an expression or if the analysis would be to complicated. I am currently not sure if this may actually happen when calling getSCEV(), because getSCEV() could just return a SCEVUnknown referencing the Value itself. Maybe SCEVCouldNotCompute is just generated by functions like SE->getBackedgeTakenCount()? In case you cannot generate a test case that yields to this, I don't think there is a need to try more. Even without such a test case the patch should be OK. Cheers Tobi
2011 Dec 04
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...the analysis would be to complicated. I am currently >> not sure if this may actually happen when calling getSCEV(), because >> getSCEV() could just return a SCEVUnknown referencing the Value itself. >> Maybe SCEVCouldNotCompute is just generated by functions like >> SE->getBackedgeTakenCount()? >> >> In case you cannot generate a test case that yields to this, I don't think >> there is a need to try more. Even without such a test case the patch should >> be OK. >> >> Cheers >> Tobi >> > > Ok, thanks, I'll try other test case...
2010 May 06
2
[LLVMdev] Back-edge taken count of loops
hi all, i am have a project need to compute the back-edge taken count of a loop, and the "getBackedgeTakenCount" function of ScalarEvolution could do this for me. but later i found that ScalarEvolution could not compute loops with test expression containing a "=", such as: void scop_func(long A[], long n) { long i; for (i = 1; i<= n; i++) A[i] = 1; } after have a look at the cod...
2013 Jul 11
1
[LLVMdev] Scalar Evolution and Loop Trip Count.
...e = ConstantInt::get(SE.getContext(), ExitVal); In gdb, $6 = {BitWidth = 8, {VAL = 254, pVal = 0xfe}} (gdb) p ExitVal.isNegative() $7 = true (gdb) p ExitValue->dump() i8 -2 $8 = void It looks like whenever the value of ExitVal is greater than 128, ExitValue is going to be negative. This makes getBackedgeTakenCount return a negative number, which does not make sense. Any thoughts ? Pranav -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
2011 Nov 21
2
[LLVMdev] How to make Polly ignore some non-affine memory accesses
Sorry for the noobish question, but what kind of subscripts generate a SCEVCouldNotCompute from the SCEV engine? I tried for a while but I wasn't able to trigger that. 2011/11/20 Tobias Grosser <tobias at grosser.es>: > On 11/20/2011 03:01 AM, Marcello Maggioni wrote: >> >> 2011/11/19 Tobias Grosser<tobias at grosser.es>: >>> >>> On 11/18/2011
2015 Oct 16
2
question about llvm partial unrolling/runtime unrolling
...p still doesn't unroll. > > The unrolling process hits this code in LoopUnrollRuntime.cpp > > // Only unroll loops with a computable trip count and the trip count > needs > // to be an int value (allowing a pointer type is a TODO item) > const SCEV *BECountSC = SE->getBackedgeTakenCount(L); > if (isa<SCEVCouldNotCompute>(BECountSC) || > !BECountSC->getType()->isIntegerTy()) > return false; > > BECountSC=0xcccccccc and returns false here. > > Based on the comments it looks like I still need a constant loop counter. > Is there a way to...
2011 Nov 03
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...wrote: > Mmm I found out a very strange behavior (to me) of the SCEV analysis > of the loop bound of the external loop I posted. > When in ScopDetection it gets the SCEV of the external loop bound in > the "isValidLoop()" function with: > const SCEV *LoopCount = SE->getBackedgeTakenCount(L); > > It returns a SCEVCouldNotCompute, but if I change the "if" block > inside the loop from: > if (i+j> 1000) > to: > if (i> 1000) > > that SCEV results valid. > > Later in the ScopInfo pass it crashes analyzing the SCEV of the > comp...
2018 Feb 11
2
[SCEV] Inconsistent SCEV formation for zext
...PessimisticMode = true; return Value; } else if (FinalCache.find(Key)) { return Value; } Insertion logic is like this- If (PessimisticMode) { PendingCache.insert(Entry); } else { FinalCache.insert(Entry); } We need to distinguish top level calls to the external interface like getSCEV()/getBackedgeTakenCount() etc from the internal recursive calls for setting/resetting the state correctly. We start with adding the most conservative result for the value in PendingCache. This would be getUnknown() for getSCEV(). So getSCEV() may be implemented something like this- ScalarEvolution::getSCEV(Value *V) {...
2010 May 06
0
[LLVMdev] Back-edge taken count of loops
...t for <= loops on trunk. ScalarEvolution now uses the nsw flag to prove that it doesn't need to consider the infinite-loop case. Dan On May 6, 2010, at 2:50 AM, ether zhhb wrote: > hi all, > > i am have a project need to compute the back-edge taken count of a loop, and the "getBackedgeTakenCount" function of ScalarEvolution could do this for me. > > but later i found that ScalarEvolution could not compute loops with test expression containing a "=", such as: > > void scop_func(long A[], long n) { > long i; > > for (i = 1; i<= n; i++) > A...
2011 May 01
0
[LLVMdev] ScalarEvolution::getSVECAtScope
...uate it by using the 04717     // loop exit value of the addrec. 04718     if (!AddRec->getLoop()->contains(L)) { 04719       // To evaluate this recurrence, we need to know how many times the AddRec 04720       // loop iterates.  Compute this now. 04721       const SCEV *BackedgeTakenCount = getBackedgeTakenCount(AddRec->getLoop()); 04722       if (BackedgeTakenCount == getCouldNotCompute()) return AddRec; 04723 04724       // Then, evaluate the AddRec. 04725       return AddRec->evaluateAtIteration(BackedgeTakenCount, *this); 04726     } The guard checks that !AddRec->getLoop()->contains(L), b...
2011 May 01
0
[LLVMdev] ScalarEvolution::getSVECAtScope
...// loop exit value of the addrec. > 04718     if (!AddRec->getLoop()->contains(L)) { > 04719       // To evaluate this recurrence, we need to know how many > times the AddRec > 04720       // loop iterates.  Compute this now. > 04721       const SCEV *BackedgeTakenCount = > getBackedgeTakenCount(AddRec->getLoop()); > 04722       if (BackedgeTakenCount == getCouldNotCompute()) return AddRec; > 04723 > 04724       // Then, evaluate the AddRec. > 04725       return AddRec->evaluateAtIteration(BackedgeTakenCount, *this); > 04726     } > > The guard checks that !AddRe...
2010 Apr 21
1
[LLVMdev] determining the number of iteration of a loop
In your example the the number of iterations is known -- it is N. It is not known at compile time, but it's known at run-time before you enter the loop. So you can do transforms like if( N < threshold ) copy of loop optimized for small iterations count; else copy of loop optimized for large iterations count; But you are right, in general, the number of iterations in unknown. I think Khaled
2011 Nov 02
5
[LLVMdev] How to make Polly ignore some non-affine memory accesses
Mmm I found out a very strange behavior (to me) of the SCEV analysis of the loop bound of the external loop I posted. When in ScopDetection it gets the SCEV of the external loop bound in the "isValidLoop()" function with: const SCEV *LoopCount = SE->getBackedgeTakenCount(L); It returns a SCEVCouldNotCompute, but if I change the "if" block inside the loop from: if (i+j > 1000) to: if (i > 1000) that SCEV results valid. Later in the ScopInfo pass it crashes analyzing the SCEV of the comparison expression (in buildConditionSets ) . It's...
2009 Feb 24
2
[LLVMdev] Detecting counted loops
I need to be able to detect a well-behaved loop. (i.e one where exp1 assigns a value to an int i, exp2 compares i with a loop constant, exp3 adjusts i by a loop constant, and the inner block has no assignments to i.) I need this because in Sun's Java VM garbage collection only takes place at safepoints, so a potentially unbounded loop must call safepoint() some time. However, safepoints are
2018 Feb 20
0
[SCEV] Inconsistent SCEV formation for zext
...lCache.find(Key)) { > return Value; > } > > Insertion logic is like this- > > If (PessimisticMode) { > PendingCache.insert(Entry); > } else { > FinalCache.insert(Entry); > } > > We need to distinguish top level calls to the external interface like getSCEV()/getBackedgeTakenCount() etc from the internal recursive calls for setting/resetting the state correctly. We start with adding the most conservative result for the value in PendingCache. This would be getUnknown() for getSCEV(). > > So getSCEV() may be implemented something like this- > > ScalarEvolution::get...