Commit e7fe2e3
use a more optimal loop implementation (#131)
In platform-tools v1.53 inlining decisions of Iterator::next prevent
LLVM from optimizing this loop into an unrolled index-based version of
it.
So where in 1.51 we'd see
```asm
INLINE_MEMMOVE($from, $to, 32 bytes)
jeq $length, 1, exit
INLINE_MEMMOVE($from, $to, 32 bytes)
jeq $length, 2, exit
...
```
In 1.53 we'd instead get a much more CU-heavy pointer-comparison based
loop instead.
```asm
lsh64 $index, 3
ldxdw r4, [r1 + 0]
add64 r1, $index
INLINE_MEMMOVE($from, $to, 32)
ldxdw r6, [r10 - 48]
jeq r1, r2, exit
; ...
```
Since we want an index-based loop here for optimal results, might as
well write it that way directly instead of relying on optimizations to
trigger.
Co-authored-by: Lucas Ste <38472950+LucasSte@users.noreply.github.com>1 parent 4a97dba commit e7fe2e3
1 file changed
Lines changed: 3 additions & 2 deletions
File tree
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments