-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Stop marking volatile indirections as NO_CSE
#62043
Stop marking volatile indirections as NO_CSE
#62043
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsIt is unnecessary - we model volatile indirections as mutating the global heap in value numbering and thus they can only ever be CSE defs, which is legal in our model (only volatile operations serve as mutators as per ECMA). We get some good small diffs this way. However, the real purpose of this change is making fixing the incorrect assertions for L-value indirections (#13762, reproduction), which will be identified by the presence of the We could venture and add something like a
|
efafc41
to
d1a7d8a
Compare
@dotnet/jit-contrib |
@dotnet/jit-contrib I am OOF next week so if somebody else wants to give this a lookover before I'm back then please do. |
It is unnecessary - we model volatile indirections as mutating the global heap in value numbering and thus they can only ever be CSE defs, which is legal in our model (only volatile operations serve as mutators as per ECMA). We get some good small diffs this way. However, the real purpose of this change is making fixing the incorrect assertions for L-value indirections, which will be identified by the presence of the GTF_NO_CSE flag, as that is the only reliable way to detect L-values in the compiler, mostly zero-diff. We could venture and add something like a GTF_LVALUE flag (I think we had one with that very name at some point...), but that seems very risky - how many a place today forgets about GTF_NO_CSE, certainly plumbing the new flag through will not be a pleasant, or good, long-term solution. The proper solution is to delete GT_ASG, but that, of course, is not something done in one weekend :), and it seems bad to leave known silent bad codegen bugs hanging around in the meantime.
d1a7d8a
to
10877fd
Compare
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! I reran the failing CI leg, so will wait for that.
It is unnecessary - we model volatile indirections as mutating the global heap in value numbering and thus they can only ever be CSE defs, which is legal in our model (only volatile operations serve as mutators as per ECMA).
We get some good small diffs this way.
However, the real purpose of this change is making fixing the incorrect assertions for L-value indirections (#13762, reproduction), which will be identified by the presence of the
GTF_NO_CSE
flag, as that is the only reliable way to detect L-values in the compiler, mostly zero-diff.We could venture and add something like a
GTF_LVALUE
flag (I think we had one with that very name at some point...), but that seems very risky - how many a place today forgets aboutGTF_NO_CSE
, certainly plumbing the new flag through will not be a pleasant, or good, long-term solution. The proper solution is to deleteGT_ASG
, but that, of course, is not something done in one weekend :), and it seems bad to leave known silent bad codegen bugs hanging around in the meantime.Full diffs.