Stream: git-wasmtime

Topic: wasmtime / issue #3953 Cranelift: avoid load coalescing w...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 21 2022 at 20:35):

abrown opened issue #3953:

In examining #3951 and #3934, the main problem in both cases seems to be that the load coalescing logic cannot detect when a loaded operand may be reused. Because of this, we must manually ensure that certain lowerings use put_in_* to avoid the problem. This is too manual and this error-prone (e.g., we unwittingly merged a regalloc error in #3951).

As @cfallin notes in #3934:

Merging a load into an op that executes more than once is invalid in general (the two loads may observe different values, which violates the original program semantics because there was only one load originally).

So load coalescing should be prevented in cases where the operand is attempted to be loaded twice. If we could check how many times a value is used in is_mergeable_load, we could avoid the need to remember to use put_in_* in these cases.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2022 at 20:10):

alexcrichton labeled issue #3953:

In examining #3951 and #3934, the main problem in both cases seems to be that the load coalescing logic cannot detect when a loaded operand may be reused. Because of this, we must manually ensure that certain lowerings use put_in_* to avoid the problem. This is too manual and this error-prone (e.g., we unwittingly merged a regalloc error in #3951).

As @cfallin notes in #3934:

Merging a load into an op that executes more than once is invalid in general (the two loads may observe different values, which violates the original program semantics because there was only one load originally).

So load coalescing should be prevented in cases where the operand is attempted to be loaded twice. If we could check how many times a value is used in is_mergeable_load, we could avoid the need to remember to use put_in_* in these cases.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2022 at 20:10):

alexcrichton labeled issue #3953:

In examining #3951 and #3934, the main problem in both cases seems to be that the load coalescing logic cannot detect when a loaded operand may be reused. Because of this, we must manually ensure that certain lowerings use put_in_* to avoid the problem. This is too manual and this error-prone (e.g., we unwittingly merged a regalloc error in #3951).

As @cfallin notes in #3934:

Merging a load into an op that executes more than once is invalid in general (the two loads may observe different values, which violates the original program semantics because there was only one load originally).

So load coalescing should be prevented in cases where the operand is attempted to be loaded twice. If we could check how many times a value is used in is_mergeable_load, we could avoid the need to remember to use put_in_* in these cases.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 23 2022 at 01:00):

cfallin closed issue #3953:

In examining #3951 and #3934, the main problem in both cases seems to be that the load coalescing logic cannot detect when a loaded operand may be reused. Because of this, we must manually ensure that certain lowerings use put_in_* to avoid the problem. This is too manual and this error-prone (e.g., we unwittingly merged a regalloc error in #3951).

As @cfallin notes in #3934:

Merging a load into an op that executes more than once is invalid in general (the two loads may observe different values, which violates the original program semantics because there was only one load originally).

So load coalescing should be prevented in cases where the operand is attempted to be loaded twice. If we could check how many times a value is used in is_mergeable_load, we could avoid the need to remember to use put_in_* in these cases.


Last updated: Dec 23 2024 at 12:05 UTC