Make regalloc visit fallthrough_return instructions.
Add an explicit "is_ghost" property to selected instructions, and use that to determine whether reload and coloring should visit instructions. This allows them to visit fallthrough_return instructions and insert fills and register moves as needed.
This commit is contained in:
committed by
Benjamin Bouvier
parent
681cb5e20a
commit
88bbbca6cd
23
cranelift/filetests/regalloc/fallthrough-return.clif
Normal file
23
cranelift/filetests/regalloc/fallthrough-return.clif
Normal file
@@ -0,0 +1,23 @@
|
||||
test regalloc
|
||||
target x86_64
|
||||
|
||||
; Test that fallthrough returns are visited by reload and coloring.
|
||||
|
||||
function %foo() -> f64 {
|
||||
fn0 = %bar()
|
||||
|
||||
ebb0:
|
||||
v0 = f64const 0.0
|
||||
call fn0()
|
||||
fallthrough_return v0
|
||||
}
|
||||
; check: fill v0
|
||||
|
||||
function %foo() -> f64 {
|
||||
fn0 = %bar() -> f64, f64
|
||||
|
||||
ebb0:
|
||||
v0, v1 = call fn0()
|
||||
fallthrough_return v1
|
||||
}
|
||||
; check: regmove v1, %xmm1 -> %xmm0
|
||||
Reference in New Issue
Block a user