Skip to content

[JIT] ARM64 - Temporary fix for ldp/stp optimizations - with test fix#90700

Merged
TIHan merged 7 commits into
dotnet:mainfrom
TIHan:runtime_85765_2
Aug 17, 2023
Merged

[JIT] ARM64 - Temporary fix for ldp/stp optimizations - with test fix#90700
TIHan merged 7 commits into
dotnet:mainfrom
TIHan:runtime_85765_2

Conversation

@TIHan

@TIHan TIHan commented Aug 16, 2023

Copy link
Copy Markdown
Contributor

Resolves #85765

With the latest, the code-gen is quite different from what was reported in the issue, and therefore doesn't reproduce. But the issue still exists and is able to be reproduced by a different sample:

using System;
using System.Runtime.CompilerServices;

// Expected: 515
// Actual: 0
public unsafe class Program
{
    public static void Main()
    {
        byte* bytes = stackalloc byte[1024];
        bytes[0x1A] = 1;
        bytes[0x1B] = 2;
        int sum = Foo(bytes);
        Console.WriteLine(sum);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    public static int Foo(byte* b)
    {
        return Unsafe.ReadUnaligned<int>(ref b[0x1A]) + Unsafe.ReadUnaligned<int>(ref b[0x1B]);
    }
}

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

ghost commented Aug 16, 2023

Copy link
Copy Markdown

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

Issue Details

null

Author: TIHan
Assignees: TIHan
Labels:

area-CodeGen-coreclr

Milestone: -

@JulieLeeMSFT JulieLeeMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check CI is green before merging.

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Aug 16, 2023
@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Aug 17, 2023
@TIHan

TIHan commented Aug 17, 2023

Copy link
Copy Markdown
Contributor Author

@JulieLeeMSFT PR is green now.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

Thanks. Approved.

@TIHan TIHan merged commit 7bc69ad into dotnet:main Aug 17, 2023
@TIHan

TIHan commented Aug 17, 2023

Copy link
Copy Markdown
Contributor Author

/backport to release/8.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5893792838

@ghost ghost locked as resolved and limited conversation to collaborators Sep 17, 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.

JIT: Invalid ldp optimization with locals

3 participants