Skip to content

Port upstream's #12715 #2079

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

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions backend/CSEgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,12 @@ method class_of_operation op =
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
| Iextcall _ | Iprobe _ | Iopaque -> assert false (* treated specially *)
| Istackoffset _ -> Op_other
| Iload { mutability = Mutable } -> Op_load Mutable
| Iload { mutability = Immutable } -> Op_load Immutable
| Iload { mutability; is_atomic } ->
(* #12173: disable CSE for atomic loads. *)
if is_atomic then Op_other
else Op_load (match mutability with
| Mutable -> Mutable
| Immutable -> Immutable)
| Istore(_,_,asg) -> Op_store asg
| Ialloc _ | Ipoll _ -> assert false (* treated specially *)
| Iintop(Icheckbound|Icheckalign _) -> Op_checkbound
Expand Down
5 changes: 4 additions & 1 deletion ocaml/asmcomp/CSEgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ method class_of_operation op =
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
| Iextcall _ | Iprobe _ | Iopaque -> assert false (* treated specially *)
| Istackoffset _ -> Op_other
| Iload { mutability } -> Op_load mutability
| Iload { mutability; is_atomic } ->
(* #12173: disable CSE for atomic loads. *)
if is_atomic then Op_other
else Op_load mutability
| Istore(_,_,asg) -> Op_store asg
| Ialloc _ | Ipoll _ -> assert false (* treated specially *)
| Iintop(Icheckbound) -> Op_checkbound
Expand Down