-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
remove fence that GC change made unnecessary #56986
remove fence that GC change made unnecessary #56986
Conversation
I'm still spooked about DSE being able to delete stores into our objects, but LGTM |
I thought we already have this fence in our safepoint lowering? |
This fence is not the safepoint one. It's specifically for the length field of a memory, which if it is unused can be DSEd out. We used to use it during sweeping to decrement the GC length, but not anymore. |
@nanosoldier |
We use it during marking, to decide what memory to access |
So that's where we have some questions. From what we've seen this was only an issue if the memory was allocated and was instantly dead (i.e never marked). Which might be wrong, though this is what we were discussing yesterday in relation to initialization. |
The package evaluation job you requested has completed - possible new issues were detected. Report summary❗ Packages that crashed2 packages crashed only on the current version.
13 packages crashed on the previous version too. ✖ Packages that failed20 packages failed only on the current version.
1311 packages failed on the previous version too. ✔ Packages that passed tests19 packages passed tests only on the current version.
5212 packages passed tests on the previous version too. ~ Packages that at least loaded11 packages successfully loaded only on the current version.
2713 packages successfully loaded on the previous version too. ➖ Packages that were skipped altogether913 packages were skipped on the previous version too. |
From looking at this with Jeff, we realized that GC-safepoints have a CST fence, which should make this safe (since that requires LLVM not to delay the store of a living object beyond the fence). |
Right, but does LLVM treat other things that are safepoints, i.e julia function calls and friends as seq-cst fences. (I believe it does) so I think merging is fine. |
I think the situation here is somewhat complicated. Currently, I believe this optimization is safe since LLVM believes that all Julia function calls may allias all memory. Interestingly, since calling a julia function may run GC this is almost true, in that any function call may read any live memory (in the mark phase), but will not read any dead memory. In some ways, this would be a lot cleaner if the safepoint on functions calls was added by the caller rather than the callee. |
@nanosoldier |
The package evaluation job you requested has completed - possible new issues were detected. Report summary✖ Packages that failed2 packages failed only on the current version.
2 packages failed on the previous version too. ✔ Packages that passed tests12 packages passed tests on the previous version too. ~ Packages that at least loaded6 packages successfully loaded on the previous version too. |
@gbaraldi and I think that this fence can probably be removed now that #55223 is merged. This should slightly expand the set of cases where the Memory is removable.