aboutsummaryrefslogtreecommitdiffstats
path: root/backend/CSE3analysis.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-15 11:50:56 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-15 11:50:56 +0200
commit3ceff391e0be39cd7a3d5d861fb1f32653579bab (patch)
tree07e6a693bac4bd8cc14723c658edd562f899789d /backend/CSE3analysis.v
parent7c6ce18466ed1de58a0f99c785c777d63a9a6149 (diff)
downloadcompcert-kvx-3ceff391e0be39cd7a3d5d861fb1f32653579bab.tar.gz
compcert-kvx-3ceff391e0be39cd7a3d5d861fb1f32653579bab.zip
some more tuning of CSE3
Diffstat (limited to 'backend/CSE3analysis.v')
-rw-r--r--backend/CSE3analysis.v27
1 files changed, 18 insertions, 9 deletions
diff --git a/backend/CSE3analysis.v b/backend/CSE3analysis.v
index 5fbabd93..7316c9a9 100644
--- a/backend/CSE3analysis.v
+++ b/backend/CSE3analysis.v
@@ -308,6 +308,12 @@ Section OPERATIONS.
| None => kill_reg dst rel
end.
+ Definition is_trivial_sym_op sop :=
+ match sop with
+ | SOp op => is_trivial_op op
+ | SLoad _ _ => false
+ end.
+
Definition oper (dst : reg) (op: sym_op) (args : list reg)
(rel : RELATION.t) : RELATION.t :=
if is_smove op
@@ -318,15 +324,18 @@ Section OPERATIONS.
| _ => kill_reg dst rel
end
else
- let args' := forward_move_l rel args in
- match rhs_find op args' rel with
- | Some r =>
- if Compopts.optim_CSE3_glb tt
- then RELATION.glb (move r dst rel)
- (oper1 dst op args' rel)
- else oper1 dst op args' rel
- | None => oper1 dst op args' rel
- end.
+ if is_trivial_sym_op op
+ then kill_reg dst rel
+ else
+ let args' := forward_move_l rel args in
+ match rhs_find op args' rel with
+ | Some r =>
+ if Compopts.optim_CSE3_glb tt
+ then RELATION.glb (move r dst rel)
+ (oper1 dst op args' rel)
+ else oper1 dst op args' rel
+ | None => oper1 dst op args' rel
+ end.
Definition clever_kill_store
(chunk : memory_chunk) (addr: addressing) (args : list reg)