diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2012-07-09 20:25:22 +0100 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-07-09 20:25:22 +0100 |
commit | 71b124e9bf07cbc64edff599dd18a6d1e313239e (patch) | |
tree | ba615550614fd16856514dd12bb42f29d69b8c32 /Source | |
parent | f101354a5b83569e31678207b72231f3520a9ca4 (diff) |
GPUVerify: merge blocks into predecessors before and after predication
Because predication produces straight line control flow, merging
after predication can dramatically reduce the number of blocks to 1
plus 2-3 per loop. We also merge before predication, which reduces
VC complexity by reducing the number of possible values for cur.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/GPUVerify/GPUVerifier.cs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/GPUVerify/GPUVerifier.cs b/Source/GPUVerify/GPUVerifier.cs index fdefdebd..62f39f76 100644 --- a/Source/GPUVerify/GPUVerifier.cs +++ b/Source/GPUVerify/GPUVerifier.cs @@ -339,9 +339,11 @@ namespace GPUVerify PullOutNonLocalAccesses();
}
-
-
-
+ private void MergeBlocksIntoPredecessors()
+ {
+ foreach (var impl in Program.TopLevelDeclarations.OfType<Implementation>())
+ VC.VCGen.MergeBlocksIntoPredecessors(Program, impl);
+ }
internal void doit()
{
@@ -401,6 +403,13 @@ namespace GPUVerify emitProgram(outputFilename + "_abstracted");
}
+ MergeBlocksIntoPredecessors();
+
+ if (CommandLineOptions.ShowStages)
+ {
+ emitProgram(outputFilename + "_merged_pre_predication");
+ }
+
MakeKernelPredicated();
if (CommandLineOptions.ShowStages)
@@ -408,6 +417,13 @@ namespace GPUVerify emitProgram(outputFilename + "_predicated");
}
+ MergeBlocksIntoPredecessors();
+
+ if (CommandLineOptions.ShowStages)
+ {
+ emitProgram(outputFilename + "_merged_post_predication");
+ }
+
MakeKernelDualised();
if (CommandLineOptions.ShowStages)
|