Add a FixedTied constraint kind for operand constraints.
Fixes #175. The Intel division instructions have fixed input operands that are clobbered by fixed output operands, so the value passed as an input will be clobbered just like a tied operand. The FixedTied operand constraint is used to indicate a fixed input operand that has a corresponding output operand with the same fixed register. Teach the spiller to teach a FixedTied operand the same as a Tied operand constraint and make sure that the input value is killed by the instruction.
This commit is contained in:
15
cranelift/filetests/regalloc/output-interference.cton
Normal file
15
cranelift/filetests/regalloc/output-interference.cton
Normal file
@@ -0,0 +1,15 @@
|
||||
test compile
|
||||
set is_64bit=1
|
||||
isa intel haswell
|
||||
|
||||
function %test(i64) -> i64 native {
|
||||
ebb0(v0: i64):
|
||||
v2 = iconst.i64 12
|
||||
; This division clobbers two of its fixed input registers on Intel.
|
||||
; These are FixedTied constraints that the spiller needs to resolve.
|
||||
v5 = udiv v0, v2
|
||||
v6 = iconst.i64 13
|
||||
v9 = udiv v0, v6
|
||||
v10 = iadd v5, v9
|
||||
return v10
|
||||
}
|
||||
Reference in New Issue
Block a user