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

[mono] Missing box optimizations in the interpreter #99463

Closed
vargaz opened this issue Mar 8, 2024 · 6 comments
Closed

[mono] Missing box optimizations in the interpreter #99463

vargaz opened this issue Mar 8, 2024 · 6 comments

Comments

@vargaz
Copy link
Contributor

vargaz commented Mar 8, 2024

The mono JIT has a bunch of optimizations for common IL code sequences like box+brtrue, box+unbox.any. The interpreter is currently missing these.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 8, 2024
@vargaz vargaz added area-Codegen-Interpreter-mono and removed untriaged New issue has not been triaged by the area owner labels Mar 8, 2024
@vargaz
Copy link
Contributor Author

vargaz commented Mar 8, 2024

@fanyang-mono

@vitek-karas
Copy link
Member

@BrzVlad

@BrzVlad
Copy link
Member

BrzVlad commented Mar 9, 2024

Any particular test case where you see this ? MINT_BOX should produce a value that is marked as non null, which is handled during cprop when we fold branches. I see we also have a pattern for recognizing box + unbox.any in transform.c.

@vargaz
Copy link
Contributor Author

vargaz commented Mar 10, 2024

There are a bunch of cases in method-to-ir.c in the CEE_BOX: section. An example is box+isinst, which is produced by:

    public static bool box<T> (T t) {
        return (t is string);
    }

@fanyang-mono
Copy link
Member

fanyang-mono commented Mar 11, 2024

This is a dup of #99379. There is a test in my PR (#99081) that is failing without this - Validate_RecognizedOpCodeSequences_Scenarios in src/tests/Loader/classloader/generics/ByRefLike/Validate.cs

@fanyang-mono
Copy link
Member

Let's move future discussions to #99379, since that issue is linked to the failing test. Closing this issue now.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants