bytecodealliance / bytecodealliance/wasmtime

Cranelift: aarch64: canonicalize `const <= value` into `value >= const` in lowering

Open
#5,270 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

This would let us reuse existing immediate-encoding optimizations for rewriting `value >= C + 1` into `value > C` when `C + 1` is odd. In general this is pretty nice to have, since it turns a four instruction sequence into a two instruction sequence.

Follow up issue from:

> In the future, we could try and "rotate" `const <= value` into `value >= const` and then go through this same optimization path so that we don't need to duplicate the rules but with tiny tweaks. I opted not to do that in this PR and removed the buggy optimizations to just get this land-able.

_Originally posted by @fitzgen in https://github.com/bytecodealliance/wasmtime/issues/5252#issuecomment-1315621231_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.