Skip to content

Handle float/double for RVA[cns] optimization in fgValueNumberConstLoad - #80661

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:vn-rva-floating-point
Jan 15, 2023
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:vn-rva-floating-point

Conversation

@EgorBo

@EgorBo EgorBo commented Jan 14, 2023 •

Copy link
Copy Markdown
Member

Follow up for #78783 to add support for double/float.

Example:

double Test()
{
    ReadOnlySpan<double> data = new double[] { 1.0, -2.0, 3.0, 4.0 };
    return data[1];
}

this now is folded into just return -2.0;

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 14, 2023
@ghost ghost assigned EgorBo Jan 14, 2023
@ghost

ghost commented Jan 14, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak
See info in area-owners.md if you want to be subscribed.

Issue Details

Example:

double Test()
{
    ReadOnlySpan<double> data = new double[] { 1.0, -2.0, 3.0, 4.0 };
    return data[1];
}

this now is folded into just return -2.0;

Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@tannergooding

tannergooding commented Jan 15, 2023 •

Copy link
Copy Markdown
Member

Can we recognize similar for Vector.Create(span) and convert to a VEC_CNS?

@EgorBo

EgorBo commented Jan 15, 2023

Copy link
Copy Markdown
Member Author

Can we recognize similar for Vector.Create(span) and convert to a VEC_CNS?

Do you mean static readonly Vector = Vector.Create ? Yeah I have a local branch with it 🙂

@EgorBo

EgorBo commented Jan 15, 2023

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib - simple change

@EgorBo
EgorBo merged commit e2e690b into dotnet:main Jan 15, 2023
@EgorBo
EgorBo deleted the vn-rva-floating-point branch January 15, 2023 16:47
@ghost ghost locked as resolved and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants