Skip to content

Instruction scheduling: do not reorder atomic loads#12248

Merged
xavierleroy merged 4 commits intoocaml:trunkfrom
xavierleroy:fix-scheduling
May 16, 2023
Merged

Instruction scheduling: do not reorder atomic loads#12248
xavierleroy merged 4 commits intoocaml:trunkfrom
xavierleroy:fix-scheduling

Conversation

@xavierleroy
Copy link
Copy Markdown
Contributor

As noticed in #11712 (comment), instruction scheduling can reorder atomic loads just like it reorders normal loads, which is incorrect.

This PR fixes the issue trivially, by treating atomic loads like stores, which are never reordered (w.r.t. other stores / atomic loads, and even w.r.t. normal loads).

This fix is mostly cosmetic, since the scheduling pass is currently unused in OCaml 5 (none of the supported target architectures need it), and may very well never be used again in the future.

Fixes: #12216

Copy link
Copy Markdown
Contributor

@nojb nojb left a comment

Choose a reason for hiding this comment

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

LGTM

xavierleroy and others added 3 commits May 16, 2023 11:42
Co-authored-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
@xavierleroy xavierleroy merged commit 8d1af24 into ocaml:trunk May 16, 2023
@xavierleroy xavierleroy deleted the fix-scheduling branch May 16, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the scheduling pass aware of the memory model

2 participants