Move code around and address growable_array comment.

- Move SideEffectsAnalysis to its own file.
- Move most of gvn.h to gvn.cc.
- Don't call Resize in GrowableArray constructor, but just set num_used
  directly.

Change-Id: I1f1291207945d678d3c99cc0ec1ec155bcae82f6
diff --git a/compiler/optimizing/gvn_test.cc b/compiler/optimizing/gvn_test.cc
index 9e630a7..4a48fee 100644
--- a/compiler/optimizing/gvn_test.cc
+++ b/compiler/optimizing/gvn_test.cc
@@ -18,6 +18,7 @@
 #include "gvn.h"
 #include "nodes.h"
 #include "optimizing_unit_test.h"
+#include "side_effects_analysis.h"
 #include "utils/arena_allocator.h"
 
 #include "gtest/gtest.h"
@@ -66,7 +67,7 @@
   graph->TryBuildingSsa();
   SideEffectsAnalysis side_effects(graph);
   side_effects.Run();
-  GlobalValueNumberer(&allocator, graph, side_effects).Run();
+  GVNOptimization(graph, side_effects).Run();
 
   ASSERT_TRUE(to_remove->GetBlock() == nullptr);
   ASSERT_EQ(different_offset->GetBlock(), block);
@@ -120,7 +121,7 @@
   graph->TryBuildingSsa();
   SideEffectsAnalysis side_effects(graph);
   side_effects.Run();
-  GlobalValueNumberer(&allocator, graph, side_effects).Run();
+  GVNOptimization(graph, side_effects).Run();
 
   // Check that all field get instructions have been GVN'ed.
   ASSERT_TRUE(then->GetFirstInstruction()->IsGoto());
@@ -191,7 +192,7 @@
   {
     SideEffectsAnalysis side_effects(graph);
     side_effects.Run();
-    GlobalValueNumberer(&allocator, graph, side_effects).Run();
+    GVNOptimization(graph, side_effects).Run();
   }
 
   // Check that all field get instructions are still there.
@@ -206,7 +207,7 @@
   {
     SideEffectsAnalysis side_effects(graph);
     side_effects.Run();
-    GlobalValueNumberer(&allocator, graph, side_effects).Run();
+    GVNOptimization(graph, side_effects).Run();
   }
 
   ASSERT_TRUE(field_get_in_loop_header->GetBlock() == nullptr);