Files
wasmtime/cranelift/codegen
Sean Stangl b4c6bfd371 When splitting a const, insert prior to the terminal branch group. (#1325)
* When splitting a const, insert prior to the terminal branch group. Closes #1159

Given code like the following, on x86_64, which does not have i128 registers:

    ebb0(v0: i64):
        v1 = iconst.i128 0
        v2 = icmp_imm eq v0, 1
        brnz v2, ebb1
        jump ebb2(v1)

It would be split to:

    ebb0(v0: i64):
        v1 = iconst.i128 0
        v2 = icmp_imm eq v0, 1
        brnz v2, ebb1
        v3, v4 = isplit.i128 v1
        jump ebb2(v3, v4)

But that fails basic-block invariants. This patch changes that to:

    ebb0(v0: i64):
        v1 = iconst.i128 0
        v2 = icmp_imm eq v0, 1
        v3, v4 = isplit.i128 v1
        brnz v2, ebb1
        jump ebb2(v3, v4)

* Add isplit-bb.clif testcase
2020-01-22 17:14:41 +01:00
..
2020-01-17 14:33:52 -08:00
2020-01-17 14:33:52 -08:00
2019-12-07 09:47:43 -08:00
2020-01-17 14:33:52 -08:00

This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.