Add an ir_if simplification pass.
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant. However, it does remove 59 lines
from the printout of CorrectParse2.vert.
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp
index 38dee95..455bf0c 100644
--- a/glsl_parser_extras.cpp
+++ b/glsl_parser_extras.cpp
@@ -36,6 +36,7 @@
#include "glsl_parser.h"
#include "ir_constant_folding.h"
#include "ir_function_inlining.h"
+#include "ir_if_simplification.h"
#include "ir_print_visitor.h"
const char *
@@ -759,6 +760,7 @@
progress = false;
progress = do_function_inlining(&instructions) || progress;
+ progress = do_if_simplification(&instructions) || progress;
/* Constant folding */
ir_constant_folding_visitor constant_folding;