diff options
Diffstat (limited to 'asmcomp')
-rw-r--r-- | asmcomp/schedgen.ml | 7 | ||||
-rw-r--r-- | asmcomp/schedgen.mli | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/asmcomp/schedgen.ml b/asmcomp/schedgen.ml index 2a0c75e5e1..5624281aee 100644 --- a/asmcomp/schedgen.ml +++ b/asmcomp/schedgen.ml @@ -181,12 +181,17 @@ method private instr_in_basic_block instr try_nesting = Can be overridden for some processors to signal specific load or store instructions (e.g. on the I386). *) +(* Stores are not reordered with other stores nor with loads. + Loads can be reordered with other loads, but not with stores. + Atomic loads must not be reordered, so we treat them like stores. *) + method is_store = function Istore(_, _, _) -> true + | Iload {is_atomic = true} -> true | _ -> false method is_load = function - Iload _ -> true + Iload {is_atomic = false} -> true | _ -> false method is_checkbound = function diff --git a/asmcomp/schedgen.mli b/asmcomp/schedgen.mli index bc3f798dad..3f2ea61f36 100644 --- a/asmcomp/schedgen.mli +++ b/asmcomp/schedgen.mli @@ -37,9 +37,10 @@ class virtual scheduler_generic : object method oper_in_basic_block : Mach.operation -> bool (* Says whether the given operation terminates a basic block *) method is_store : Mach.operation -> bool - (* Says whether the given operation is a memory store *) + (* Says whether the given operation is a memory store + or an atomic load. *) method is_load : Mach.operation -> bool - (* Says whether the given operation is a memory load *) + (* Says whether the given operation is a non-atomic memory load *) method is_checkbound : Mach.operation -> bool (* Says whether the given operation is a checkbound *) (* Entry point *) |