Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review duplication of loads in the Jit #75916

Open
SingleAccretion opened this issue Sep 20, 2022 · 3 comments
Open

Review duplication of loads in the Jit #75916

SingleAccretion opened this issue Sep 20, 2022 · 3 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@SingleAccretion
Copy link
Contributor

SingleAccretion commented Sep 20, 2022

See #75790 (comment).

We have a few places in the Jit where loads can potentially be duplicated, one especially high-risk area is address-exposed locals (everything that uses the "spill if complex, clone if local" pattern). See also #78713.

It would also be useful to think about whether we can debug-check this sort of thing.

category:cq
theme:addressing-modes

@SingleAccretion SingleAccretion added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 20, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 20, 2022
@ghost
Copy link

ghost commented Sep 20, 2022

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

Issue Details

See #75790 (comment).

We have a few places in the Jit where loads can potentially be duplicated, one especially high-risk area is address-exposed locals (everything that uses the "spill if complex, clone if local" pattern). Redundant relop optimization is another known source.

It would also be useful to think about whether we can debug-check this sort of thing.

RLO reproduction (requires JitNoCSE=1):

[MethodImpl(MethodImplOptions.NoInlining)]
private static int Problem(int* p)
{
    var b = *p == 1;
    var c = b;
    if (b)
    {
        JitUse(c);
        return 2;
    }

    return 1;
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static void JitUse<T>(T arg) { }
Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Sep 20, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Sep 20, 2022
@JulieLeeMSFT
Copy link
Member

@markples PTAL.

@markples
Copy link
Member

markples commented Jun 8, 2023

I'm going to mark this as priority:2. However, in practice that is going to mean (1) #78713 and (2) audit some "obvious" things (superficial look at copy/clone sites, audit "obvious" places (does regalloc rematerialize values). I don't have plans for figuring out a debug check. In general, this is a "do we have bugs" work item which is very open-ended, though of course it's a new requirement so it makes sense to give it some direct thought.

@markples markples added the Priority:2 Work that is important, but not critical for the release label Jun 8, 2023
@JulieLeeMSFT JulieLeeMSFT modified the milestones: 8.0.0, 9.0.0 Jul 28, 2023
@jakobbotsch jakobbotsch removed the Priority:2 Work that is important, but not critical for the release label May 15, 2024
@jakobbotsch jakobbotsch modified the milestones: 9.0.0, 10.0.0 Jul 29, 2024
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

No branches or pull requests

4 participants