diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2015-04-05 17:26:44 +0100 |
---|---|---|
committer | Dan Liew <daniel.liew@imperial.ac.uk> | 2015-04-05 17:26:44 +0100 |
commit | fde61624bc8b47a947d0da8a76632e8b8aeaacb6 (patch) | |
tree | f3bb761d550455594937f44251cc93fba77329fa /Source/Predication/SmartBlockPredicator.cs | |
parent | aef3a0dbd0ac676bf7aa6428587f26ad5a945879 (diff) |
Patch by Jeroen Ketema.
Drop the “basic” block predication algorithm. Block predication is only used
by GPUVerify, and then only in the “smart” version as the basic algorithm does
not perform very well. As a consequence this code is essentially dead.
Diffstat (limited to 'Source/Predication/SmartBlockPredicator.cs')
-rw-r--r-- | Source/Predication/SmartBlockPredicator.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Predication/SmartBlockPredicator.cs b/Source/Predication/SmartBlockPredicator.cs index 7579158d..739f0e2b 100644 --- a/Source/Predication/SmartBlockPredicator.cs +++ b/Source/Predication/SmartBlockPredicator.cs @@ -606,4 +606,32 @@ public class SmartBlockPredicator { }
+class EnabledReplacementVisitor : StandardVisitor
+{
+ private Expr pExpr;
+ private Expr pDomExpr;
+
+ internal EnabledReplacementVisitor(Expr pExpr, Expr pDomExpr)
+ {
+ this.pExpr = pExpr;
+ this.pDomExpr = pDomExpr;
+ }
+
+ public override Expr VisitExpr(Expr node)
+ {
+ if (node is IdentifierExpr)
+ {
+ IdentifierExpr iExpr = node as IdentifierExpr;
+ if (iExpr.Decl is Constant && QKeyValue.FindBoolAttribute(iExpr.Decl.Attributes, "__enabled"))
+ {
+ return pExpr;
+ } else if (iExpr.Decl is Constant && QKeyValue.FindBoolAttribute(iExpr.Decl.Attributes, "__dominator_enabled"))
+ {
+ return pDomExpr;
+ }
+ }
+ return base.VisitExpr(node);
+ }
+}
+
}
|