search for: getsmallconstanttripcount

Displaying 20 results from an estimated 24 matches for "getsmallconstanttripcount".

2011 Apr 27
2
[LLVMdev] getSmallConstantTripCount problem
In my pass, I add LoopInfo as a required pass. Then I'd like to print the constant loop trip count of each loop if it has one. However, every time I call loop-> getSmallConstantTripCount(), it returns 0, even for a very simple loop: for(i=0; i<3; ++i) {;} What's the possible cause of this problem? regards, Bo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110427/e5b8b3ba/attachment....
2012 May 21
1
[LLVMdev] No getSmallConstantTripCount function in current LLVM version
Hi, I cannot find the getSmallConstantTripCount function in the current LLVM. Can anyone tell me whether there is still such a function to get the trip count in LLVM? Thank you very much. Best, Han
2012 Jan 18
2
[LLVMdev] getSmallConstantTripCount function doesn't work for obvious cases
Hi, My pass heavily relies on llvm::Loop's getSmallConstantTripCount method. However, I found that it doesn't work for some simple cases. In the following example, I can get the constant trip count of the outermost loop if statement "a[l] = a[l] + 1" is there. After commenting out this line, the returned constant trip count for that loop is 0. In my p...
2013 Sep 27
2
[LLVMdev] Trip count and Loop Vectorizer
..., and found that LLVM LoopVectorizer successfully vectorizes and unrolls the inner loop. However, in order to take the fast path (vmovups) it must copy at least 32 ints, where as in this case we only do an 8int copy. ** Upon closer look, LoopVectorizer obtains the TripCount for the innerloop using getSmallConstantTripCount(Loop,...). This value is 0 for the loop with unknown trip count. Loop unrolling is disabled when TC > 0. Should this be changed to TC >= 0 (which does the job for this testcase)? Or is there a better way to disable loop unrolling for such trivial loops, at least the ones with known array size...
2013 Sep 27
0
[LLVMdev] Trip count and Loop Vectorizer
...analysis. The problem here, both for memcpy and the vectorizer, is that we can’t predict the size of “n”, even though the only use of ’n’ is for the loop bound for the alloca [4 x [8 x i32]]. If you change the unroll condition to TC >= 0 then you will disable loop unrolling for all loops because getSmallConstantTripCount returns an unsigned number. You can control the unroll factor using metadata or using the command line tools. Thanks, Nadav On Sep 27, 2013, at 9:41 AM, Murali, Sriram <sriram.murali at intel.com> wrote: > Hi, > I am trying to get a small loop to *not vectorize* for cases where it...
2016 Sep 16
4
SCEV cannot compute the trip count of Simple loop
...<nsw> on (3 + %x) and (6 + %x) to fold the expression above to "3", but due to some systemic issues SCEV can't exploit <nsw> as aggressively as we should. Without exploiting <nsw> the trip count is 2^32, which does not fit in an 32 bit unsigned integer. This is why getSmallConstantTripCount returns 0. Does this answer your question? -- Sanjoy
2010 Apr 21
2
[LLVMdev] determining the number of iteration of a loop
Hello I'm wandring to know how many times a block is executed inside a loop ? knowing that I can't use getSmallConstantTripCount() because the number is unkown "for (i=0;i<N;i++) for example" I'm using a Function pass for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { if (Loop *L = LI->getLoopFor(BB)) { if (L->getHeader() == BB) { t...
2008 May 09
3
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
...o moved the RemapInstruction and > FoldBlockIntoPredecessor support functions there. > > Additionally, I've also moved the loop unrolling statistics into the > Utils file. Is > that a good idea? > > I've added two new methods to Loop (or LoopBase<> really): > getSmallConstantTripCount() and getSmallConstantTripMultiple(), > which return > the trip count and multiple as a normal unsigned value. > > There are a number of remaining issues, though. Firstly, I observe > some code > duplication. Every pass that performs loop unrolling, should depend > on the...
2008 May 09
0
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
...sed by the LoopUnroll pass. I've also moved the RemapInstruction and FoldBlockIntoPredecessor support functions there. Additionally, I've also moved the loop unrolling statistics into the Utils file. Is that a good idea? I've added two new methods to Loop (or LoopBase<> really): getSmallConstantTripCount() and getSmallConstantTripMultiple(), which return the trip count and multiple as a normal unsigned value. There are a number of remaining issues, though. Firstly, I observe some code duplication. Every pass that performs loop unrolling, should depend on the LoopSimplify, LCSSA and LoopInfo passes...
2013 Sep 27
2
[LLVMdev] Trip count and Loop Vectorizer
...here, both for memcpy and the vectorizer, is that we can't predict the size of "n", even though the only use of 'n' is for the loop bound for the alloca [4 x [8 x i32]]. If you change the unroll condition to TC >= 0 then you will disable loop unrolling for all loops because getSmallConstantTripCount returns an unsigned number. You can control the unroll factor using metadata or using the command line tools. Thanks, Nadav On Sep 27, 2013, at 9:41 AM, Murali, Sriram <sriram.murali at intel.com<mailto:sriram.murali at intel.com>> wrote: Hi, I am trying to get a small loop to *not...
2008 May 07
8
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hello Matthijs, Separating mechanism from policy is a good thing for the LoopUnroll pass. Instead of moving the policy to a subclass though, I think it'd be better to move the mechanism, the unrollLoop function, out to be a standalone utility function, with the LoopInfo object passed in explicitly. FoldBlockIntoPredecessor would also be good to make into a standalone utility function, since
2010 Apr 21
0
[LLVMdev] determining the number of iteration of a loop
On Apr 21, 2010, at 7:31 AM, khaled hamidouche wrote: > I'm wandring to know how many times a block is executed inside a > loop ? > knowing that I can't use getSmallConstantTripCount() because the > number is unkown "for (i=0;i<N;i++) for example" In general, the number of iterations is undecidable. For example: int main(char **argv, int N) { for (int i = 0; i < N; i++) { std::cout << "arg: " << argv[i] << std::...
2012 Jul 02
2
[LLVMdev] Alternative of Loop::getTripCount?
I found out that Loop::getTripCount method is obsolete in LLVM 3.1 Is there an alternative? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120702/ea6ca4e6/attachment.html>
2012 Jul 03
0
[LLVMdev] Alternative of Loop::getTripCount?
Hi Taemin, On 03/07/2012 01:53, Taemin Kim wrote: > I found out that Loop::getTripCount method is obsolete in LLVM 3.1 > Is there an alternative? I use getSmallConstantTripCount() to get loop trip counts using the ScalarEvolution analysis pass. See include/llvm/Analysis/ScalarEvolution.h for a detailed explanation. Ivan > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiu...
2008 May 07
1
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
...uld > add a > getTripCountConst() (or getTripCountInt() ?) and > getTripCountMultiple() to > Loop? > > > It seems to me the second option is nicer, though it shouldn't make > too much > of a difference. The second option sounds nicer to me too. Is the name getSmallConstantTripCount too paranoid? > > > Furthermore, where to put this utility class? lib/Transforms/ > UnrollLoop.cpp > seems reasonable? Transform utilities can go under lib/Transforms/Utils. :-) Dan
2013 Sep 27
0
[LLVMdev] Trip count and Loop Vectorizer
...analysis. The problem here, both for memcpy and the vectorizer, is that we can’t predict the size of “n”, even though the only use of ’n’ is for the loop bound for the alloca [4 x [8 x i32]]. If you change the unroll condition to TC >= 0 then you will disable loop unrolling for all loops because getSmallConstantTripCount returns an unsigned number. You can control the unroll factor using metadata or using the command line tools. > > Thanks, > Nadav > > > On Sep 27, 2013, at 9:41 AM, Murali, Sriram <sriram.murali at intel.com> wrote: > > > Hi, > I am trying to get a small...
2010 Aug 12
0
[LLVMdev] Questions about trip count
...;dump(); errs() << "BB:\t" << BB->getNameStr() << "\n" ; errs() << "Is simplifyed loop?\t" << l->isLoopSimplifyForm() << "\n" ; errs() << "Tripcount " << l->getSmallConstantTripCount() << "\n" ; const PHINode* phi = l->getCanonicalInductionVariable(); errs() << "Induction variable: " << *phi << "\n"; } } } When I feed it with this program: int main(int argc, char** argv) { int i =...
2010 Apr 21
1
[LLVMdev] determining the number of iteration of a loop
.... Eugene On Wed, Apr 21, 2010 at 10:28 PM, Trevor Harmon <Trevor.W.Harmon at nasa.gov> wrote: > On Apr 21, 2010, at 7:31 AM, khaled hamidouche wrote: > >> I'm wandring to know how many times a block is executed inside a >> loop  ? >> knowing that I can't use  getSmallConstantTripCount() because the >> number is unkown  "for (i=0;i<N;i++)  for example" > > In general, the number of iterations is undecidable. For example: > > int main(char **argv, int N) { >     for (int i = 0; i < N; i++) { >         std::cout << "arg: " &lt...
2008 May 07
0
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi Dan, > This should still make it easy to write new unrolling passes with > custom heuristics, but it would also be more flexible for passes to > do unrolling in combination with other transformations. Agreed. To shed some light on my specific requirements, I am working with an architecture that has only limited support for loops and control flow. This means that loop unrolling is not
2016 Sep 16
2
SCEV cannot compute the trip count of Simple loop
...nd (6 + %x) > to fold the expression above to "3", but due to some systemic issues > SCEV can't exploit <nsw> as aggressively as we should. > > Without exploiting <nsw> the trip count is 2^32, which does not fit in > an 32 bit unsigned integer. This is why getSmallConstantTripCount > returns 0. > > Does this answer your question? > > -- Sanjoy > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/...