Add a calling-convention setting to the `Flags` used as part of the `TargetIsa`. This allows Cretonne code that generates calls to use the correct convention, such as when emitting libcalls during legalization or when the wasm frontend is decoding functions. This setting can be overridden per-function. This also adds "fast", "cold", and "fastcall" conventions, with "fast" as the new default. Note that "fast" and "cold" are not intended to be ABI-compatible across Cretonne versions. This will also ensure Windows users will get an `unimplemented!` rather than silent calling-convention mismatches, which reflects the fact that Windows calling conventions are not yet implemented. This also renames SpiderWASM, which isn't camel-case, to Baldrdash, which is, and which is also a more relevant name.
48 lines
723 B
Plaintext
48 lines
723 B
Plaintext
; Use "test compile" here otherwise the dead blocks won't be eliminated.
|
|
test compile
|
|
|
|
set is_64bit
|
|
isa x86 haswell
|
|
|
|
; This function contains unreachable blocks which trip up the register
|
|
; allocator if they don't get cleared out.
|
|
function %unreachable_blocks(i64 vmctx) -> i32 baldrdash {
|
|
ebb0(v0: i64):
|
|
v1 = iconst.i32 0
|
|
v2 = iconst.i32 0
|
|
jump ebb2
|
|
|
|
ebb2:
|
|
jump ebb4
|
|
|
|
ebb4:
|
|
jump ebb2
|
|
|
|
; Everything below this point is unreachable.
|
|
|
|
ebb3(v3: i32):
|
|
v5 = iadd.i32 v2, v3
|
|
jump ebb6
|
|
|
|
ebb6:
|
|
jump ebb6
|
|
|
|
ebb7(v6: i32):
|
|
v7 = iadd.i32 v5, v6
|
|
jump ebb8
|
|
|
|
ebb8:
|
|
jump ebb10
|
|
|
|
ebb10:
|
|
jump ebb8
|
|
|
|
ebb9(v8: i32):
|
|
v10 = iadd.i32 v7, v8
|
|
jump ebb1(v10)
|
|
|
|
ebb1(v11: i32):
|
|
return v11
|
|
}
|
|
|