-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Some refactoring of thread suspension. #34666
Changes from all commits
69a7c52
42a7724
1c638ab
8e5552f
84ba563
7d07d08
8b94660
fb96a82
2eccc8a
06fac28
4f607d4
ecaa594
480225d
18eadb4
46dc216
47acd9c
6f49f33
61b6665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4016,8 +4016,11 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) | |
value = gtNewIndOfIconHandleNode(TYP_INT, (size_t)addrTrap, GTF_ICON_GLOBAL_PTR, false); | ||
} | ||
|
||
// Treat the reading of g_TrapReturningThreads as volatile. | ||
value->gtFlags |= GTF_IND_VOLATILE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it reasonable to remove the volatility here? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in c++ an equivalent load is done via So we only need to ensure that this load is not optimizable.
since noone could optimize the load, no special flags are needed. I've added a comment explaining this instead. #Resolved |
||
// NOTE: in c++ an equivalent load is done via LoadWithoutBarrier() to ensure that the | ||
// program order is preserved. (not hoisted out of a loop or cached in a local, for example) | ||
// | ||
// Here we introduce the read really late after all major optimizations are done, and the location | ||
// is formally unknown, so noone could optimize the load, thus no special flags are needed. | ||
|
||
// Compare for equal to zero | ||
GenTree* trapRelop = gtNewOperNode(GT_EQ, TYP_INT, value, gtNewIconNode(0, TYP_INT)); | ||
|
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.
Does this need to be marked as non-CSEable at least? #Resolved
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.
non-CSEable
would be good to have. I thought this is injected by JIT after optimizations.In c++ we use compiler-only fences to make sure the read gets emitted in program order (the only gurantee that we need on the read side).
Some equivalent would be sufficient in JIT code as well.
#Resolved
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.
Added GTF_DONT_CSE
In reply to: 503509382 [](ancestors = 503509382)