SCM Repository
View of /trunk/src/compiler/IL/ssa-check-fn.sml
Parent Directory
|
Revision Log
Revision 3349 -
(download)
(annotate)
Tue Oct 27 15:16:36 2015 UTC (5 years, 5 months ago) by jhr
File size: 1248 byte(s)
Tue Oct 27 15:16:36 2015 UTC (5 years, 5 months ago) by jhr
File size: 1248 byte(s)
making copyrights consistent for all code in the repository
(* ssa-check-fn.sml * * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu) * * COPYRIGHT (c) 2015 The University of Chicago * All rights reserved. * * Consistency checking for SSA representation *) functor SSACheckFn (IL : SSA) : sig end = struct (* things to check: * 1) SSA property * 2) variable usage counts * 3) successor/predecessor matching in CFG * 4) arity of operators *) fun checkRHS (OP(rator, args)) = (* check operator arity *) if Op.arity rator <> List.length args then (* error *) else () | checkRHS _ = () fun checkNode (node as IL.ND{kind, ...}) = let val preds = IL.Node.preds nd val succs = IL.Node.succs nd val inList = List.exists (fn nd => IL.Node.same(node, nd)) in if List.all (fn nd => inList(IL.Node.succs nd)) (IL.Node.preds nd) then () else (* error: predecessor/successor mismatch *); if List.all (fn nd => inList(IL.Node.preds nd)) (IL.Node.succs nd) then () else (* error: successor/predecessor mismatch *); case kind of NULL => (* error: unexpected NULL *) | JOIN{phis, ...} => | BLOCK{body, ...} => | _ => () (* end case *)) end end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |