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

JIT: Remove GT_CAST handling in Lowering::IsValidConstForMovImm #106092

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

amanasifkhalid
Copy link
Member

Fixes #106020 (comment).

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 7, 2024
@@ -1931,17 +1931,21 @@ bool Lowering::IsValidConstForMovImm(GenTreeHWIntrinsic* node)
GenTree* op1 = node->Op(1);
GenTree* castOp = nullptr;

// TODO-Casts: why don't we fold the casts? MinOpts?
// In MinOpts, casts won't be folded during importation
if (varTypeIsIntegral(node->GetSimdBaseType()) && op1->OperIs(GT_CAST))
Copy link
Member

Choose a reason for hiding this comment

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

Does removing this handling entirely have any significant diffs outside MinOpts?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried removing this, and (surprisingly?) I didn't get any diffs, so this code pattern doesn't seem common enough to even help MinOpts all that much. Maybe we should get rid of it altogether.

@amanasifkhalid amanasifkhalid changed the title JIT: Skip GT_CAST removal in Lowering::IsValidConstForMovImm if it might change immediate JIT: Remove GT_CAST handling in Lowering::IsValidConstForMovImm Aug 8, 2024
@amanasifkhalid
Copy link
Member Author

No diffs in CI, either.

@amanasifkhalid amanasifkhalid merged commit dbdfabf into dotnet:main Aug 8, 2024
114 checks passed
@amanasifkhalid amanasifkhalid deleted the fix-cast-lowering branch August 8, 2024 14:40
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
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: Assertion failed '(imm < maxVal) || ((imm & signBitsMask) == signBitsMask)' during 'Generate code'
2 participants