-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Ensure that folding of unary mask operations doesn't modify the tracked op2 #117380
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
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the JIT’s unary mask folding to preserve the original second operand and adds a regression test reproducing the issue (fixes #117378).
- Adjust
gtFoldExprHWIntrinsicto useeffectiveOperand avoid mutatingop2directly. - Add a new JIT regression test project and C# test to trigger the assertion.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/jit/gentree.cpp | Refactored mask-folding logic to handle GT_NOT without modifying op2 |
| src/tests/JIT/Regression/JitBlue/Runtime_117377/Runtime_117377.csproj | Added new test project |
| src/tests/JIT/Regression/JitBlue/Runtime_117377/Runtime_117377.cs | Added generated test case calling the problematic intrinsic code |
Comments suppressed due to low confidence (2)
src/tests/JIT/Regression/JitBlue/Runtime_117377/Runtime_117377.csproj:3
- The project file is missing a element, so it won’t build. Add something like net8.0 inside the PropertyGroup to match other JIT tests.
<Optimize>True</Optimize>
src/tests/JIT/Regression/JitBlue/Runtime_117377/Runtime_117377.cs:32
- To ensure this method isn’t inlined (and thus triggers the intended JIT folding path), add [MethodImpl(MethodImplOptions.NoInlining)] above M4. Remember to import System.Runtime.CompilerServices.
public byte M4()
src/tests/JIT/Regression/JitBlue/Runtime_117377/Runtime_117377.cs
Outdated
Show resolved
Hide resolved
amanasifkhalid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
/ba-g unrelated timeouts/failures |
This resolves #117378