Added BranchUtils.h/.cpp files that contain several visitors and mutators used by the specialize_branched_loops optimization pass. I have pulled this work out into its own file to improve the readability of the specialize_branched_loops stuff, and make it easier to test and review these components.
Fixed compile errors in BranchUtils. Added the beginnings of a correctness test to check the validity of the functions in BranchUtils.
Added some tests to check the correctness of the normalize and prune functions in BranchUtils.
Changed the names of the BranchUtils files to BranchVisitors. Added some more comments to BranchVisitors.cpp file at the top of each class to indicate what it does. Rearrange the order of the functions and visitors in the file to match the order in which they are intended to be used. Also, fixed a minor but important bug that could potentially lead to infinite loops when a select expr was found in the condition of an if stmt.
Merge master
Fixed some compile errors that shouldn't have made it in the last commit.
Merge branch 'master' into branch_utils
Addressed some of the minor comments on the outstanding pull request for this branch.
Merge branch 'linear_solver' into branch_utils
Changed branches_in_var to the more useful branches_linearly_in_vars. Currently, we only mutate Stmts where the branching conditions depend linearly on some variable. This change also allows us to detect branching in more than one variable at a time.
Merge branch 'linear_solver' into branch_utils
Fixed some bugs continued converting BranchVisitors to using new linearity tests from linear_solver branch.
Merge branch 'linear_solver' into branch_visitors
Modified normalize_branch_conditions to include the pruning step after normalizing. Removed the pruning functions from the public header file. Commented out the NormalizeBranches::visit(Variable) method, as it is not clear if this method needs to examine the bound variables in the scope or not, and if it does whether or not it can do it safely.
Merge branch 'master' into branch_visitors
An important bug fix, and some minor cleanup.
Fixed a comment.
Removed some unnecessary code.
Fixed branch_vistors test to use new interface to normalize_branch_conditions
Updated the comment on NormalizeBranches::visit(Variable) to indicate why the approach used in this visitor is safe.