Reland "Eliminate unreachable code during optimization."
This is a reland of c6260f974261ee9fb5dc9573669559d728a856e8
Problematic DeadReturn.sksl test cases have been moved to DeadReturnES3.
Original change's description:
> Eliminate unreachable code during optimization.
>
> The Adreno 5xx and 6xx previously failed the SkSLStaticSwitchInline
> test; the driver struggled to interpret code with multiple return
> statements in a row. We now detect unreachable statements and eliminate
> them.
>
> Change-Id: I344d632f2488ca65b0635b37bebffe6e4fb607c5
> Bug: skia:12012
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410256
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12012
Change-Id: I748e8761cbc71c811b5ad8fe49186f980261d8b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410793
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h
index f58149b..19375ad 100644
--- a/src/sksl/SkSLCompiler.h
+++ b/src/sksl/SkSLCompiler.h
@@ -204,6 +204,9 @@
bool removeDeadGlobalVariables(Program& program, ProgramUsage* usage);
bool removeDeadLocalVariables(Program& program, ProgramUsage* usage);
+ /** Eliminates unreachable statements from a Program. */
+ void removeUnreachableCode(Program& program, ProgramUsage* usage);
+
Position position(int offset);
std::shared_ptr<Context> fContext;