summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2010-02-16 23:04:53 +0000
committerGravatar qadeer <unknown>2010-02-16 23:04:53 +0000
commit0549304b5beaf553ba3e5fa6550a6b8e43e31553 (patch)
tree1333dc7fd6b911b4a2e0cd001c7dd3955e1c5c40 /Source/Core
parent717eaee0063074b804098d3cfd44a7a3f822b064 (diff)
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.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DeadVarElim.ssc11
1 files changed, 11 insertions, 0 deletions
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<Block!> multiPredBlocks = ComputeMultiPredecessorBlocks(impl);
Set<Block!> visitedBlocks = new Set<Block!>();
Set<Block!> removedBlocks = new Set<Block!>();
@@ -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<Block> dag = new Graph<Block>();