aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Fasse <justus.fasse@etu.univ-grenoble-alpes.fr>2021-08-10 23:47:42 +0200
committerJustus Fasse <justus.fasse@etu.univ-grenoble-alpes.fr>2021-08-10 23:51:16 +0200
commit21edfe0d156d92777af862fbbb68aad3758cd5fe (patch)
treeeddfc7631ea87a36e4542a7f275952259643fd6f
parent549cc16118d0c1f80084016c4a0d73a5d43dc221 (diff)
downloadcompcert-kvx-21edfe0d156d92777af862fbbb68aad3758cd5fe.tar.gz
compcert-kvx-21edfe0d156d92777af862fbbb68aad3758cd5fe.zip
Do not incur latency hit for the fake-read of the memory by a side exit
-rw-r--r--aarch64/PrepassSchedulingOracle.ml18
1 files changed, 16 insertions, 2 deletions
diff --git a/aarch64/PrepassSchedulingOracle.ml b/aarch64/PrepassSchedulingOracle.ml
index 49e4870c..db62287d 100644
--- a/aarch64/PrepassSchedulingOracle.ml
+++ b/aarch64/PrepassSchedulingOracle.ml
@@ -455,6 +455,18 @@ let get_fake_deps_liveness (opweights : opweights) (seqa : (instruction*Regset.t
end;
last_mem_reads := i :: !last_mem_reads
end
+ and add_input_mem_formality i =
+ if not (use_alias_analysis ())
+ then
+ begin
+ begin
+ (* Read after write *)
+ match !last_mem_write with
+ | None -> ()
+ | Some j -> add_constraint j i 0
+ end;
+ last_mem_reads := i :: !last_mem_reads
+ end
and add_output_mem i =
if not (use_alias_analysis ())
then
@@ -588,7 +600,7 @@ let get_fake_deps_liveness (opweights : opweights) (seqa : (instruction*Regset.t
failwith "Ibuiltin"
| Icond(cond, inputs, _, _, _) ->
set_branch i;
- add_input_mem i;
+ add_input_mem_formality i;
add_input_regs i inputs
| Ijumptable(input, _) ->
set_branch i;
@@ -647,7 +659,9 @@ let get_fake_deps_liveness_stores (opweights : opweights) (seqa : (instruction*R
if not (use_alias_analysis ())
then
begin
- List.iter (fun j -> add_constraint j i 1) !writes_to_commit;
+ (* cf. add_input_mem_formality *)
+ (* We can compensate for movement across a single branch, but not two. *)
+ List.iter (fun j -> add_constraint j i 0) !writes_to_commit;
writes_to_commit := !last_mem_writes;
last_mem_writes := (match !last_mem_writes with
| [] -> []