Commit 7a213e1
committed
armv6m: Reduce heuristic threshold for
Literal pools need to be within 1024 bytes because of limited range of
ldr reg, [pc, #imm] instruction. A pool is emitted when mov_immediate is
called and the pool reference is farther than a given threshold. Emitting
the pool in such a condition requires a branch over the pool, and is
therefore less efficient than the usual pool flush that happens when a
branch is emitted (tail calls).
This threshold was set to 900 but new test module bigint.beam wouldn't
compile. This commit changes the threshold to 512 which works (the test
actually requires 663).
The optimal threshold value depends on the pattern usage of mov_immediate.
If regular code hits the bug, we may need to change the heuristic and emit the
pool based on other conditions.
Signed-off-by: Paul Guyot <pguyot@kallisys.net>maybe_flush_literal_pool
1 parent 58768ab commit 7a213e1
File tree
2 files changed
+28
-26
lines changed- libs/jit/src
- tests/libs/jit
2 files changed
+28
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2771 | 2771 | | |
2772 | 2772 | | |
2773 | 2773 | | |
2774 | | - | |
| 2774 | + | |
| 2775 | + | |
2775 | 2776 | | |
2776 | | - | |
| 2777 | + | |
2777 | 2778 | | |
2778 | 2779 | | |
2779 | 2780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3055 | 3055 | | |
3056 | 3056 | | |
3057 | 3057 | | |
3058 | | - | |
| 3058 | + | |
3059 | 3059 | | |
3060 | 3060 | | |
3061 | 3061 | | |
3062 | | - | |
| 3062 | + | |
3063 | 3063 | | |
3064 | 3064 | | |
3065 | | - | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
3070 | 3070 | | |
3071 | 3071 | | |
3072 | | - | |
| 3072 | + | |
3073 | 3073 | | |
3074 | 3074 | | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
3079 | 3079 | | |
3080 | 3080 | | |
3081 | 3081 | | |
| |||
3091 | 3091 | | |
3092 | 3092 | | |
3093 | 3093 | | |
3094 | | - | |
| 3094 | + | |
3095 | 3095 | | |
3096 | 3096 | | |
3097 | 3097 | | |
3098 | | - | |
3099 | | - | |
| 3098 | + | |
| 3099 | + | |
3100 | 3100 | | |
3101 | | - | |
3102 | | - | |
3103 | | - | |
3104 | | - | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
3105 | 3106 | | |
3106 | 3107 | | |
3107 | | - | |
| 3108 | + | |
3108 | 3109 | | |
3109 | 3110 | | |
3110 | | - | |
3111 | | - | |
3112 | | - | |
3113 | | - | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
3114 | 3115 | | |
3115 | 3116 | | |
3116 | 3117 | | |
| |||
0 commit comments