-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: Remove questionable transformation #95249
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 Issue Detailsnull
|
|
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
src/coreclr/jit/optimizer.cpp
Outdated
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.
What IR does this create for the example case we were looking at?
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.
It used to be:
[000002] ----G+----- * CAST long <- int
[000001] n---G+----- \--* IND byte
[000000] H----+----- \--* CNS_INT(h) long 0x7ffa2213f21a static Fseq[s_13]
to
[000002] ----G+----- * NOP byte
[000001] n---G+----- \--* IND byte
[000000] H----+----- \--* CNS_INT(h) long 0x7ffa2213f21a static Fseq[s_13]
Now it's:
[000002] ----G+----- * CAST long <- int
[000001] n---G+----- \--* IND byte
[000000] H----+----- \--* CNS_INT(h) long 0x7ffa22c7f21a static Fseq[s_13]
to
[000002] ----G+----- * CAST int <- byte <- int
[000001] n---G+----- \--* IND byte
[000000] H----+----- \--* CNS_INT(h) long 0x7ffa22c7f21a static Fseq[s_13]
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.
That's still an illegal transformation in this case since the value was an argument. The new cast does not guarantee widening into the upper 32 bits like the original cast does.
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.
@jakobbotsch are you suggesting to remove the whole transformation?
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.
It seems there are two separate questions:
- Who is invoking
optNarrowTreein this way that changes semantics of the program? The transformation is questionable to me but it's because the end result is a change change in behavior -- and this PR still has that problem. - Can we get rid of the weird passthrough
GT_NOP? Yes, and this PR probably accomplishes that, but it seems a better way would be to refactoroptNarrowTreeto take aGenTree**so that it can just replace the use of the cast with the operand in this situation.
I'm more worried about (1) than (2), though it would also be nice to clean up (2).
|
If you are deleting this quirky runtime/src/coreclr/jit/valuenum.cpp Lines 11371 to 11375 in 721c445
and runtime/src/coreclr/jit/rationalize.cpp Lines 252 to 264 in 721c445
|
5ad1f2f to
bbd96d7
Compare
|
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
There's probably some more stuff to fix around optNarrowTree, but this looks good to me to unblock the Fuzzlyn runs.
gtEffectiveVal can be cleaned up too now if passthrough NOPs no longer exist... but doesn't necessarily have to be in this PR.
No description provided.