Commit 00dc332
authored
Move the split point to the first fixed use (#165)
Address bytecodealliance/wasmtime#7147 by
moving the bundle split point to the first fixed use found after the
suggested split point. This implementation only considers the first
liverange that contains the split point, so there's room for
improvement.
The intent with this change is to not artificially constrain the bundle
produced after the split point by leaving unconstrained uses that could
be kept above the split point. Splitting at the first fixed use after
the suggested split point should produce a less constrained upper
bundle, which will be easier to allocate.
One interesting effect from the example in the issue linked above is
that the change of split point alone does not fix the problem, as we
also trim the space around the split point into the spill bundle. Doing
this creates the same splits that we would have arrived at before, as
the second load doesn't use `v1` all and thus that region is trimmed to
the spill bundle. I addressed that by disabling trimming when the split
point is advanced, under the assumption that the point moving means that
you probably want to give the allocator another chance with both
bundles.
I'm not sure that this implementation is the right path forward
currently, as it might be better to perform the heuristic outside of the
call to `split_and_requeue_bundle`, allowing us the flexibility to make
the decision about trimming at that point.1 parent 4777ec9 commit 00dc332
1 file changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
499 | 524 | | |
500 | 525 | | |
501 | 526 | | |
| |||
0 commit comments