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:
Dan Gohman
2018-10-26 06:39:44 -07:00
committed by Benjamin Bouvier
parent 681cb5e20a
commit 88bbbca6cd
5 changed files with 101 additions and 60 deletions

View 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