Skip to content

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Jan 23, 2026

Some interesting diffs are produced.

I slowly mimic what SSA-based GetRange does, but purely on top of VNs and assertions. This should be, in theory, more powerful, doesn't require a separate "does overflow" path, can be called from Global Assertion Prop general optimizations.

simple example:

void Test(bool cond, int[] arr)
{
    int x = cond ? -1 : -2;   // [-2..-1]
    int y = arr?.Length ?? 0; // [0..Array.MaxLength]

    if (x > y) // always false -- it's now folded
        Console.WriteLine("below zero");
}

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 23, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant