diff options
author | Mike Pall <mike> | 2011-05-03 21:14:18 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-05-03 21:14:18 +0200 |
commit | 139175f8c48af3ceefb6838dabc0f1222fd150b1 (patch) | |
tree | 141b71e31d6b9a7543eced6baa62a081bb20b056 /src | |
parent | c77ca54564e63b7ac20a570eee84c57142d6960a (diff) | |
download | luajit-139175f8c48af3ceefb6838dabc0f1222fd150b1.tar.gz luajit-139175f8c48af3ceefb6838dabc0f1222fd150b1.tar.bz2 luajit-139175f8c48af3ceefb6838dabc0f1222fd150b1.zip |
Tune loop unrolling heuristics. Increase trace recorder limits.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_jit.h | 6 | ||||
-rw-r--r-- | src/lj_record.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h index 92631440..cced4813 100644 --- a/src/lj_jit.h +++ b/src/lj_jit.h | |||
@@ -67,17 +67,17 @@ | |||
67 | /* Optimization parameters and their defaults. Length is a char in octal! */ | 67 | /* Optimization parameters and their defaults. Length is a char in octal! */ |
68 | #define JIT_PARAMDEF(_) \ | 68 | #define JIT_PARAMDEF(_) \ |
69 | _(\010, maxtrace, 1000) /* Max. # of traces in cache. */ \ | 69 | _(\010, maxtrace, 1000) /* Max. # of traces in cache. */ \ |
70 | _(\011, maxrecord, 2000) /* Max. # of recorded IR instructions. */ \ | 70 | _(\011, maxrecord, 4000) /* Max. # of recorded IR instructions. */ \ |
71 | _(\012, maxirconst, 500) /* Max. # of IR constants of a trace. */ \ | 71 | _(\012, maxirconst, 500) /* Max. # of IR constants of a trace. */ \ |
72 | _(\007, maxside, 100) /* Max. # of side traces of a root trace. */ \ | 72 | _(\007, maxside, 100) /* Max. # of side traces of a root trace. */ \ |
73 | _(\007, maxsnap, 100) /* Max. # of snapshots for a trace. */ \ | 73 | _(\007, maxsnap, 500) /* Max. # of snapshots for a trace. */ \ |
74 | \ | 74 | \ |
75 | _(\007, hotloop, 56) /* # of iter. to detect a hot loop/call. */ \ | 75 | _(\007, hotloop, 56) /* # of iter. to detect a hot loop/call. */ \ |
76 | _(\007, hotexit, 10) /* # of taken exits to start a side trace. */ \ | 76 | _(\007, hotexit, 10) /* # of taken exits to start a side trace. */ \ |
77 | _(\007, tryside, 4) /* # of attempts to compile a side trace. */ \ | 77 | _(\007, tryside, 4) /* # of attempts to compile a side trace. */ \ |
78 | \ | 78 | \ |
79 | _(\012, instunroll, 4) /* Max. unroll for instable loops. */ \ | 79 | _(\012, instunroll, 4) /* Max. unroll for instable loops. */ \ |
80 | _(\012, loopunroll, 7) /* Max. unroll for loop ops in side traces. */ \ | 80 | _(\012, loopunroll, 15) /* Max. unroll for loop ops in side traces. */ \ |
81 | _(\012, callunroll, 3) /* Max. unroll for recursive calls. */ \ | 81 | _(\012, callunroll, 3) /* Max. unroll for recursive calls. */ \ |
82 | _(\011, recunroll, 2) /* Min. unroll for true recursion. */ \ | 82 | _(\011, recunroll, 2) /* Min. unroll for true recursion. */ \ |
83 | \ | 83 | \ |
diff --git a/src/lj_record.c b/src/lj_record.c index 36425086..41b2221a 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -521,7 +521,9 @@ static void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev) | |||
521 | */ | 521 | */ |
522 | if (!innerloopleft(J, pc)) | 522 | if (!innerloopleft(J, pc)) |
523 | lj_trace_err(J, LJ_TRERR_LINNER); /* Root trace hit an inner loop. */ | 523 | lj_trace_err(J, LJ_TRERR_LINNER); /* Root trace hit an inner loop. */ |
524 | if ((J->loopref && J->cur.nins - J->loopref > 8) || --J->loopunroll < 0) | 524 | if ((J->loopref && J->cur.nins - J->loopref > |
525 | ((IRRef)J->param[JIT_P_maxrecord] >> 5)) || | ||
526 | --J->loopunroll < 0) | ||
525 | lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */ | 527 | lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */ |
526 | J->loopref = J->cur.nins; | 528 | J->loopref = J->cur.nins; |
527 | } | 529 | } |