Commit 01904ff
authored
Redefine a minimal bundle to have only one LiveRange. (#214)
When exerting additional pressure on regalloc with
bytecodealliance/wasmtime#10502, which can lead to call instructions
that have significantly more (`any`-constrained) defs, we hit panics in
RA2 where (i) a bundle merged several LiveRanges, (ii) one of these
LiveRanges had a fixed-reg constraint on an early use, (iii) this
fixed-reg constraint conflicted with a clobber (which always happens at
the late-point), (iv) the bundle merged in another LiveRange of some
arbitrary def at the late point.
This would make a bundle (which is the atomic unit of allocation) that
covers the whole inst, including the late point; and is required to be
in the fixed reg; this is unallocatable because the clobber is also at
the late point in that reg.
Our allocate-or-split-and-retry logic does not split if a bundle is
"minimal". This is meant to give a base case to the retries: when
bundles break down into their minimal pieces, any solvable set of
constraints should result in allocations.
Unfortunately the "is minimal" predicate definition did not account for
multiple LiveRanges, but rather only tested whether the total
program-point range of the bundle was over one instruction. If there are
multiple LiveRanges, we can still split them off, and the resulting
split bundles may cover only half the instruction, avoiding the
clobbers.1 parent 3b6f83a commit 01904ff
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
280 | | - | |
| 281 | + | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| |||
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | | - | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| 305 | + | |
| 306 | + | |
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
| |||
0 commit comments