File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -238,8 +238,12 @@ method class_of_operation op =
238
238
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
239
239
| Iextcall _ | Iprobe _ | Iopaque -> assert false (* treated specially *)
240
240
| Istackoffset _ -> Op_other
241
- | Iload { mutability = Mutable } -> Op_load Mutable
242
- | Iload { mutability = Immutable } -> Op_load Immutable
241
+ | Iload { mutability; is_atomic } ->
242
+ (* #12173: disable CSE for atomic loads. *)
243
+ if is_atomic then Op_other
244
+ else Op_load (match mutability with
245
+ | Mutable -> Mutable
246
+ | Immutable -> Immutable )
243
247
| Istore (_ ,_ ,asg ) -> Op_store asg
244
248
| Ialloc _ | Ipoll _ -> assert false (* treated specially *)
245
249
| Iintop (Icheckbound |Icheckalign _ ) -> Op_checkbound
Original file line number Diff line number Diff line change @@ -226,7 +226,10 @@ method class_of_operation op =
226
226
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
227
227
| Iextcall _ | Iprobe _ | Iopaque -> assert false (* treated specially *)
228
228
| Istackoffset _ -> Op_other
229
- | Iload { mutability } -> Op_load mutability
229
+ | Iload { mutability; is_atomic } ->
230
+ (* #12173: disable CSE for atomic loads. *)
231
+ if is_atomic then Op_other
232
+ else Op_load mutability
230
233
| Istore (_ ,_ ,asg ) -> Op_store asg
231
234
| Ialloc _ | Ipoll _ -> assert false (* treated specially *)
232
235
| Iintop (Icheckbound) -> Op_checkbound
You can’t perform that action at this time.
0 commit comments