Module CSSAninterf
Require Import Coqlib.
Require Import Errors.
Require Import Maps.
Require Import AST.
Require Import Globalenvs.
Require Import Smallstep.
Require Import Dom.
Require Import Op.
Require Import SSA.
Require Import SSAutils.
Require Import Utils.
Require Import CSSA.
Require Import DLib.
Require Import CSSAval.
Require Import RTLpargen.
Require Import CSSAutils.
Require Import CSSAdef.
Require Import Registers.
Unset Allow StrictProp.
Interference
Variant ninterfere_spec (
f :
function) (
r1 r2 :
reg) :
Prop :=
|
ninterfere_spec_ssaval :
cssaval_spec f (
compute_cssaval_function f) ->
compute_cssaval_function f r1 =
compute_cssaval_function f r2 ->
ninterfere_spec f r1 r2
|
ninterfere_spec_liverange :
ninterlive_spec f r1 r2 ->
ninterfere_spec f r1 r2.
Lemma test_ninterlive_correct :
forall f lv r1 r2 d1 d2 def
(
WFF:
wf_cssa_function f),
CSSAlive.analyze f =
Some lv ->
compute_def f (
get_all_def f) =
def ->
CSSA.def f r1 d1 ->
CSSA.def f r2 d2 ->
negb
((
peq (
def r1) (
def r2)) ||
SSARegSet.mem r1
(
PMap.get (
def r2)
lv) ||
(
SSARegSet.mem r2
(
PMap.get (
def r1)
lv))) =
true ->
ninterlive_spec f r1 r2.
Proof.
Lemma compute_ninterfere_correct :
forall f ninterfere r1 r2 d1 d2
(
WFF:
wf_cssa_function f),
cssaval_spec f (
compute_cssaval_function f) ->
compute_ninterfere f (
get_all_def f)
(
get_ext_params f (
get_all_def f)) =
OK ninterfere ->
ninterfere r1 r2 =
true ->
CSSA.def f r1 d1 ->
CSSA.def f r2 d2 ->
ninterfere_spec f r1 r2.
Proof.
class interference stuff
Lemma check_interference_with_class_correct :
forall r class ninterf,
check_interference_with_class r class ninterf =
true ->
forall r',
In r'
class ->
ninterf r r' =
true.
Proof.
induction class;
intros.
simpl in *.
contradiction.
simpl in *.
destruct H0.
rewrite H0 in *.
rewrite andb_true_iff in H.
tauto.
apply IHclass.
rewrite andb_true_iff in H.
tauto.
auto.
Qed.
Lemma ninterf_symmetric :
forall f x y all_defs ninterf,
compute_ninterfere f all_defs
(
get_ext_params f all_defs) =
Errors.OK ninterf ->
ninterf x y =
ninterf y x.
Proof.
Lemma check_interference_in_class_correct :
forall ninterf class,
check_interference_in_class class ninterf =
true ->
forall r r',
In r class ->
In r'
class ->
r <>
r' ->
(
forall x y,
ninterf x y =
ninterf y x) ->
ninterf r r' =
true.
Proof.
Lemma mem_class_reg_correct_true :
forall regrepr classes r,
mem_class_reg regrepr classes r =
true ->
(
exists class,
PTree.get (
regrepr r)
classes =
Some class /\
In r class) \/
(
r =
regrepr r /\
PTree.get (
regrepr r)
classes =
None).
Proof.
Lemma mem_class_regs_correct :
forall regrepr classes reglist r,
In r reglist ->
mem_class_regs regrepr classes reglist =
true ->
(
exists class,
PTree.get (
regrepr r)
classes =
Some class /\
In r class) \/
(
r =
regrepr r /\
PTree.get (
regrepr r)
classes =
None).
Proof.