From 84062edef96de98481916fc31080efe516a28948 Mon Sep 17 00:00:00 2001 From: Ally Donaldson Date: Wed, 5 Mar 2014 16:57:11 +0000 Subject: Fix to predication --- Source/Predication/SmartBlockPredicator.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Source/Predication') diff --git a/Source/Predication/SmartBlockPredicator.cs b/Source/Predication/SmartBlockPredicator.cs index ea526591..37161f05 100644 --- a/Source/Predication/SmartBlockPredicator.cs +++ b/Source/Predication/SmartBlockPredicator.cs @@ -79,6 +79,7 @@ public class SmartBlockPredicator { cCmd.Ins.Insert(0, p != null ? p : Expr.True); cmdSeq.Add(cCmd); } else if (p == null) { + new EnabledReplacementVisitor(Expr.True).Visit(cmd); cmdSeq.Add(cmd); } else if (cmd is AssignCmd) { var aCmd = (AssignCmd)cmd; @@ -224,7 +225,7 @@ public class SmartBlockPredicator { return; } } - + if (uni != null && uni.IsUniform(impl.Name, block.Item1)) { if (blockGraph.Headers.Contains(block.Item1)) { parentMap[block.Item1] = header; @@ -520,6 +521,15 @@ public class SmartBlockPredicator { } } } + } else { + if (impl == null) { + foreach (Requires r in proc.Requires) { + new EnabledReplacementVisitor(Expr.True).VisitExpr(r.Condition); + } + foreach (Ensures e in proc.Ensures) { + new EnabledReplacementVisitor(Expr.True).VisitExpr(e.Condition); + } + } } if (impl != null) { -- cgit v1.2.3