summaryrefslogtreecommitdiff
path: root/Source/GPUVerify/MayBePowerOfTwoAnalyser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Source/GPUVerify/MayBePowerOfTwoAnalyser.cs')
-rw-r--r--Source/GPUVerify/MayBePowerOfTwoAnalyser.cs31
1 files changed, 3 insertions, 28 deletions
diff --git a/Source/GPUVerify/MayBePowerOfTwoAnalyser.cs b/Source/GPUVerify/MayBePowerOfTwoAnalyser.cs
index 506add7c..c0f00dda 100644
--- a/Source/GPUVerify/MayBePowerOfTwoAnalyser.cs
+++ b/Source/GPUVerify/MayBePowerOfTwoAnalyser.cs
@@ -67,20 +67,12 @@ namespace GPUVerify
private void Analyse(Implementation Impl)
{
- Analyse(Impl, Impl.StructuredStmts);
+ Analyse(Impl, verifier.RootRegion(Impl));
}
- private void Analyse(Implementation impl, StmtList stmtList)
+ private void Analyse(Implementation impl, IRegion region)
{
- foreach (BigBlock bb in stmtList.BigBlocks)
- {
- Analyse(impl, bb);
- }
- }
-
- private void Analyse(Implementation impl, BigBlock bb)
- {
- foreach (Cmd c in bb.simpleCmds)
+ foreach (Cmd c in region.Cmds())
{
if (c is AssignCmd)
{
@@ -102,23 +94,6 @@ namespace GPUVerify
}
}
}
-
- if (bb.ec is WhileCmd)
- {
- WhileCmd wc = bb.ec as WhileCmd;
- Analyse(impl, wc.Body);
- }
- else if (bb.ec is IfCmd)
- {
- IfCmd ifCmd = bb.ec as IfCmd;
- Analyse(impl, ifCmd.thn);
- if (ifCmd.elseBlock != null)
- {
- Analyse(impl, ifCmd.elseBlock);
- }
- Debug.Assert(ifCmd.elseIf == null);
- }
-
}
private bool isPowerOfTwoOperation(Variable v, Expr expr)