Skip to content

Draft fix for a series of multiplications (#75413)#75414

Closed
SkiFoD wants to merge 1 commit into
dotnet:mainfrom
SkiFoD:skifod/issue-75413
Closed

Draft fix for a series of multiplications (#75413)#75414
SkiFoD wants to merge 1 commit into
dotnet:mainfrom
SkiFoD:skifod/issue-75413

Conversation

@SkiFoD

@SkiFoD SkiFoD commented Sep 11, 2022

Copy link
Copy Markdown
Contributor

Created a draft fix for the series of multiplications.

@ghost ghost added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member labels Sep 11, 2022
@ghost

ghost commented Sep 11, 2022

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

Created a draft fix for the series of multiplications.

Author: SkiFoD
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Comment thread src/coreclr/jit/morph.cpp

mul->gtOp1 = lsOpChOp1;
mul->gtOp2 = lsOpChOp2;
mul->gtOp2->AsIntConCommon()->SetIntegralValue(root_val + child_val);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should you check if root_val+child_val can overflow here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems there must be some checks, but I can't think of any right now.

The tricky part is that multiplications become shifts and the value transforms from a number to a count of shifts. I don't know if it actually possible to make
X >> 2,147,483,647

There is another problem with the PR which made me mark it as a draft. The problem is that the PR causes 9 regressions (along with some improvements) I need some help in addressing them.

It would be very nice if someone from the team became a reviewer.

@ghost ghost closed this Oct 11, 2022
@ghost

ghost commented Oct 11, 2022

Copy link
Copy Markdown

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2022
This pull request was closed.
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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants