From 0549304b5beaf553ba3e5fa6550a6b8e43e31553 Mon Sep 17 00:00:00 2001 From: qadeer Date: Tue, 16 Feb 2010 23:04:53 +0000 Subject: 1. Removed a quadratic loop in SimplifyLikeLineariser.ssc in favor of a linear procedure call 2. Inlining requires two fields OriginalBlocks and OriginalLocVars in Implementation. These are set just before inlining is called and now I reset them to null afterwards to help garbage collection. 3. Clear live variables right after passification again to help garbage collection. --- Source/Core/DeadVarElim.ssc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Source/Core') diff --git a/Source/Core/DeadVarElim.ssc b/Source/Core/DeadVarElim.ssc index e60a59c3..ba7f377b 100644 --- a/Source/Core/DeadVarElim.ssc +++ b/Source/Core/DeadVarElim.ssc @@ -76,6 +76,9 @@ namespace Microsoft.Boogie } public override Implementation! VisitImplementation(Implementation! impl) { + //Console.WriteLine("Procedure {0}", impl.Name); + //Console.WriteLine("Initial number of blocks = {0}", impl.Blocks.Count); + Set multiPredBlocks = ComputeMultiPredecessorBlocks(impl); Set visitedBlocks = new Set(); Set removedBlocks = new Set(); @@ -117,11 +120,19 @@ namespace Microsoft.Boogie } } impl.Blocks = newBlocks; + + //Console.WriteLine("Final number of blocks = {0}", impl.Blocks.Count); return impl; } } public class LiveVariableAnalysis { + public static void ClearLiveVariables(Implementation! impl) { + foreach (Block! block in impl.Blocks) { + block.liveVarsBefore = null; + } + } + public static void ComputeLiveVariables(Implementation! impl) { Microsoft.Boogie.Helpers.ExtraTraceInformation("Starting live variable analysis"); Graphing.Graph dag = new Graph(); -- cgit v1.2.3