dotnet / dotnet/runtime

Optimize checks against close integer values.

Open
#129,400 3 comments 0 reactions 0 assignees View on GitHub
area-CodeGen-coreclr help wanted tenet-performance
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

### Description
Checks like `i == 0 || i == -1` or `i == 0 || i == -2` currently get emitted as separate checks instead of an optimal combined check.

### Configuration
any

### Regression?
no

### Data
Current codegen: https://compiler-explorer.com/z/eaGv9easn
Desired codegen from C++: https://godbolt.org/z/avq3odcoP

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.