Also consider fixed outputs for replace_global_defines.
Fixes #178. When an instruction with a fixed output operand defines a globally live SSA value, we need to check if the fixed register is available in the `regs.global` set of registers that can be used across EBB boundaries. If the fixed output register is not available in regs.global, set the replace_global_defines flag so the output operands are rewritten as local values.
This commit is contained in:
17
cranelift/filetests/regalloc/global-fixed.cton
Normal file
17
cranelift/filetests/regalloc/global-fixed.cton
Normal file
@@ -0,0 +1,17 @@
|
||||
test compile
|
||||
set is_64bit=1
|
||||
isa intel haswell
|
||||
|
||||
function %foo() native {
|
||||
ebb4:
|
||||
v3 = iconst.i32 0
|
||||
jump ebb3
|
||||
|
||||
ebb3:
|
||||
v9 = udiv v3, v3
|
||||
jump ebb1
|
||||
|
||||
ebb1:
|
||||
v19 = iadd.i32 v9, v9
|
||||
jump ebb3
|
||||
}
|
||||
Reference in New Issue
Block a user