Stream: git-wasmtime

Topic: wasmtime / issue #10298 Cranelift: handle flags in a bett...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 26 2025 at 17:43):

cfallin opened issue #10298:

As part of the discussion on #10276, the topic of our ProducesFlags/ConsumesFlags abstraction came up, and the general consensus is that although the type-safety it provides is welcome, the mechanism itself is clunky and annoying to maintain in several ways:

In general, it would be great if we could come up with a better solution. To recap, the main benefit that this abstraction provides is that it allows ISLE to ensure a flag producer and consumer (or multiple consumers) are placed next to each other in VCode, with no intermediate instruction clobbering flags. This is ordinarily not ensured in ISLE: we allow right-hand sides to encode a tree of operators and the emit order is implicit and not directly encoded (only that it obeys data dependencies, which is ensured by the ISLE evaluation order calling a constructor before its return value is used).

In the Cranelift weekly today we discussed a few alternatives:

Consensus seemed to land on the last option. There is still some work to do to evaluate exactly how we can fit this into cases where ProducesFlags/ConsumesFlags values are passed programmatically between different helpers. E.g., IcmpCondResult is an interesting case -- do we just take a sequence there as the producer-sequence, and in e.g. jmp_cond_icmp, append the jump? This is still more safe than a carefully-crafted-emit-order solution, because all emits into the pseudoinst buffer are explicit; basically it's just admitting that we need to be more free-form about the sequences and less prescriptive about specific shapes of producer and consumer patterns. Also, the actual API for emitting instructions into a buffer needs to be carefully designed -- do we allow any inst to do so? Do we use the _raw constructors that folks mentioned over in #10276?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2025 at 17:57):

cfallin added the enhancement label to Issue #10298.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2025 at 17:57):

cfallin added the cranelift label to Issue #10298.


Last updated: Feb 28 2025 at 03:10 UTC