search for: loopnest

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

2020 Jul 24
2
Regarding the project "Create LoopNestPass"
Hi, I would like to give a quick update on what my current design and implementation go like. Basically, the `FunctionToLoopPassAdaptor` is now modified to a generic version `FunctionToLoopUnitPassAdaptor`, which allows re-using the existing codes to implement `FunctionToLoopNestPassAdaptor`, with the help of additional metadata associated with `Loop` and `LoopNest`. Both `FunctionToLoopPassAdaptor` and `FunctionToLoopNestPassAdaptor` are aliases to `FunctionToLoopUnitPassAdaptor` and they operates on `Loop`, and the `FunctionToLoopNestPassAdaptor` will construct the `LoopN...
2020 Jul 18
3
Regarding the project "Create LoopNestPass"
Hi, Thanks for your help! I've checked the sources that you mentioned. Currently, I think that I would need to implement a FunctionToLoopNestPassAdaptor which is essentially the same as the FunctionToLoopPassAdaptor but operates only on LI.getTopLevelLoops(). We might also need a LNPMUpdater (LoopNestPassManagerUpdater) which disallows adding inner-loops back into the pipeline, and LoopNestPassManager will simply be PassManager<Loop,...
2020 Jul 15
2
Regarding the project "Create LoopNestPass"
Hi, I'm a college student who is quite new to the community and is interested in contributing to the LLVM project. Although I haven't applied to GSoC, I notice that the project "Create LoopNestPass" seems to be unassigned. So I'm curious whether anyone is currently working on it, and if not, is it possible for me to work on it as a side-project? I've been programming in C++ for quite a while, and I've walked through the `LoopPass`, `LoopNest`, and some other LLVM classes...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Do not allow break to break across function calls
...: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [BUILTIN] Do not allow break to break across function calls As it is if you do a multi-level break inside a function it'll actually include loops outside of the function call. This is counterintuitive. This patch changes this by saving and resetting loopnest when entering a function. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index ccd5e0c0..204f1e57 100644 ---...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Do not allow break to break across function calls
...t allow break to break across function calls [ dash commit ebfdd97a10e34a5e70eadfc21ebfc033ef93a563 ] As it is if you do a multi-level break inside a function it'll actually include loops outside of the function call. This is counterintuitive. This patch changes this by saving and resetting loopnest when entering a function. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 1c76d4c5..e0c21f94 100644 ---...
2019 Jan 25
0
[klibc:update-dash] [EVAL] Move common skipcount logic into skiploop
...alskip; + + switch (skip) { + case 0: + break; + + case SKIPBREAK: + case SKIPCONT: + if (likely(--skipcount <= 0)) { + evalskip = 0; + break; + } + + skip = SKIPBREAK; + break; + } + + return skip; +} + + STATIC void evalloop(union node *n, int flags) { + int skip; int status; loopnest++; status = 0; flags &= EV_TESTED; - for (;;) { + do { int i; evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip) { -skipping: if (evalskip == SKIPCONT && --skipcount <= 0) { - evalskip = 0; - continue; - } - if (evalskip == SKIPBREAK && --skipcou...
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Move common skipcount logic into skiploop
...alskip; + + switch (skip) { + case 0: + break; + + case SKIPBREAK: + case SKIPCONT: + if (likely(--skipcount <= 0)) { + evalskip = 0; + break; + } + + skip = SKIPBREAK; + break; + } + + return skip; +} + + STATIC void evalloop(union node *n, int flags) { + int skip; int status; loopnest++; status = 0; flags &= EV_TESTED; - for (;;) { + do { int i; evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip) { -skipping: if (evalskip == SKIPCONT && --skipcount <= 0) { - evalskip = 0; - continue; - } - if (evalskip == SKIPBREAK && --skipcou...
2017 Apr 13
3
Question on induction variable simplification pass
...able simplification pass prefers doing a zero-extension to compute the wider trip count of loops when extending the IV. This can sometimes result in loss of information making ScalarEvolution's analysis conservative which can lead to missed performance opportunities. For example, consider this loopnest- int i, j; for(i=0; i< 40; i++) for(j=0; j< i-1; j++) A[i+j] = j; We are mainly interested in the backedge taken count of the inner loop. Before indvars, the backedge information computed by ScalarEvolution is as follows- Outer loop- backedge-taken count is 39 max backedge-take...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Only restore exit status on exit/return
...ne EXEXIT 4 /* exit the shell via exitcmd */ /* diff --git a/usr/dash/eval.c b/usr/dash/eval.c index bba0e7f8..1aad31a0 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -114,12 +114,13 @@ STATIC const struct builtincmd bltin = { INCLUDE "eval.h" EXITRESET { - evalskip = 0; - loopnest = 0; if (savestatus >= 0) { - exitstatus = savestatus; + if (exception == EXEXIT || evalskip == SKIPFUNCDEF) + exitstatus = savestatus; savestatus = -1; } + evalskip = 0; + loopnest = 0; } #endif @@ -318,7 +319,7 @@ out: if (flags & EV_EXIT) { exexit: - exraise(EXEXIT);...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...exitstatus; if (n->type != NWHILE) i = !i; if (i != 0) break; - evaltree(n->nbinary.ch2, flags); - status = exitstatus; + status = evaltree(n->nbinary.ch2, flags); skip = skiploop(); } while (!(skip & ~SKIPCONT)); - if (skip != SKIPFUNC) - exitstatus = status; loopnest--; + + return status; } -STATIC void +STATIC int evalfor(union node *n, int flags) { struct arglist arglist; union node *argp; struct strlist *sp; struct stackmark smark; + int status; errlinno = lineno = n->nfor.linno; if (funcline) @@ -414,28 +409,31 @@ evalfor(union nod...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...exitstatus; if (n->type != NWHILE) i = !i; if (i != 0) break; - evaltree(n->nbinary.ch2, flags); - status = exitstatus; + status = evaltree(n->nbinary.ch2, flags); skip = skiploop(); } while (!(skip & ~SKIPCONT)); - if (skip != SKIPFUNC) - exitstatus = status; loopnest--; + + return status; } -STATIC void +STATIC int evalfor(union node *n, int flags) { struct arglist arglist; union node *argp; struct strlist *sp; struct stackmark smark; + int status; errlinno = lineno = n->nfor.linno; if (funcline) @@ -414,28 +409,31 @@ evalfor(union nod...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Allow return in loop conditional to set exit status
...a/usr/dash/eval.c b/usr/dash/eval.c index bb106368..57db825b 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -387,8 +387,9 @@ evalloop(union node *n, int flags) status = exitstatus; skip = skiploop(); } while (!(skip & ~SKIPCONT)); + if (skip != SKIPFUNC) + exitstatus = status; loopnest--; - exitstatus = status; }
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Allow return in loop conditional to set exit status
...a/usr/dash/eval.c b/usr/dash/eval.c index 6cc92c19..bb9fc260 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -387,8 +387,9 @@ evalloop(union node *n, int flags) status = exitstatus; skip = skiploop(); } while (!(skip & ~SKIPCONT)); + if (skip != SKIPFUNC) + exitstatus = status; loopnest--; - exitstatus = status; }
2019 Jan 25
0
[klibc:update-dash] eval: Variable assignments on functions are no longer persistent
...raise; break; @@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.p = argv + 1; shellparam.optind = 1; shellparam.optoff = -1; - pushlocalvars(); evaltree(func->n.ndefun.body, flags & EV_TESTED); - poplocalvars(0); funcdone: INTOFF; loopnest = saveloopnest;
2020 Mar 28
0
[klibc:update-dash] dash: eval: Variable assignments on functions are no longer persistent
...raise; break; @@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.p = argv + 1; shellparam.optind = 1; shellparam.optoff = -1; - pushlocalvars(); evaltree(func->n.ndefun.body, flags & EV_TESTED); - poplocalvars(0); funcdone: INTOFF; loopnest = saveloopnest;
2020 Mar 28
0
[klibc:update-dash] dash: eval: avoid leaking memory associated with redirections
...(funcline) lineno -= funcline - 1; - setstackmark(&smark); arglist.lastp = &arglist.list; for (argp = n->nfor.args ; argp ; argp = argp->narg.next) { expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); @@ -420,7 +424,6 @@ evalfor(union node *n, int flags) break; } loopnest--; - popstackmark(&smark); return status; } @@ -433,14 +436,12 @@ evalcase(union node *n, int flags) union node *cp; union node *patp; struct arglist arglist; - struct stackmark smark; int status = 0; errlinno = lineno = n->ncase.linno; if (funcline) lineno -= funcline...
2020 Mar 28
0
[klibc:update-dash] dash: mkinit: Split reset into exitreset and reset
...insertions(+), 5 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 13e690e7..ff27ba9c 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -112,7 +112,7 @@ STATIC const struct builtincmd bltin = { #ifdef mkinit INCLUDE "eval.h" -RESET { +EXITRESET { evalskip = 0; loopnest = 0; if (savestatus >= 0) { diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 59a202cb..6ea0562f 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -1780,7 +1780,7 @@ varunset(const char *end, const char *var, const char *umsg, int varflags) INCLUDE "expand.h" -RES...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...command */ int back_exitstatus; /* exit status of backquoted command */ +int savestatus = -1; /* exit status of last command outside traps */ #if !defined(__alpha__) || (defined(__GNUC__) && __GNUC__ >= 3) @@ -114,6 +115,10 @@ INCLUDE "eval.h" RESET { evalskip = 0; loopnest = 0; + if (savestatus >= 0) { + exitstatus = savestatus; + savestatus = -1; + } } #endif diff --git a/usr/dash/eval.h b/usr/dash/eval.h index dc8acd2a..6e62137a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -37,6 +37,7 @@ extern char *commandname; /* currently executing command */...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...command */ int back_exitstatus; /* exit status of backquoted command */ +int savestatus = -1; /* exit status of last command outside traps */ #if !defined(__alpha__) || (defined(__GNUC__) && __GNUC__ >= 3) @@ -114,6 +115,10 @@ INCLUDE "eval.h" RESET { evalskip = 0; loopnest = 0; + if (savestatus >= 0) { + exitstatus = savestatus; + savestatus = -1; + } } #endif diff --git a/usr/dash/eval.h b/usr/dash/eval.h index dc8acd2a..6e62137a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -37,6 +37,7 @@ extern char *commandname; /* currently executing command */...
2010 Jun 29
2
[LLVMdev] Confuse on getSCEVAtScope
hi all, i have SCEVAddRec {{(32 + @edge.8265),+,32}<Loop0>,+,4}<Loop1> where Loop0 and Loop1 are brothers (loops at the same level of the loopnest), and Loop0 have a computable backedge taken count. when i call getSCEVAtScope({{(32 + @edge.8265),+,32}<Loop0>,+,4}<Loop1> , Loop1), it just give me a {{(32 + @edge.8265),+,32}<Loop0>,+,4}<Loop1>, instead of {some_value, + ,4}<loop0>, where some_value is getSCEVAtS...