Revert "Enable profiled guided compilation in dex2oat"

The test still have some flakiness in it which didn't reproduce locally.

This reverts commit 500c9be1f261a8a95ae7a25f4f8084f43207f313.

Change-Id: I132aff62bf03c2f926aafde6869707573bae9b36
diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc
index 18ce563..39f8ee8 100644
--- a/compiler/dex/mir_analysis.cc
+++ b/compiler/dex/mir_analysis.cc
@@ -1430,4 +1430,8 @@
                                  method_lowering_infos_.data(), count);
 }
 
+bool MIRGraph::SkipCompilationByName(const std::string& methodname) {
+  return cu_->compiler_driver->SkipCompilation(methodname);
+}
+
 }  // namespace art
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index 3191fe9..2da8a98 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -564,6 +564,11 @@
   bool SkipCompilation(std::string* skip_message);
 
   /*
+   * Should we skip the compilation of this method based on its name?
+   */
+  bool SkipCompilationByName(const std::string& methodname);
+
+  /*
    * Parse dex method and add MIR at current insert point.  Returns id (which is
    * actually the index of the method in the m_units_ array).
    */
diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc
index 3260a7a..05dde9f 100644
--- a/compiler/dex/quick/quick_compiler.cc
+++ b/compiler/dex/quick/quick_compiler.cc
@@ -780,6 +780,14 @@
   PassDriverMEOpts pass_driver(GetPreOptPassManager(), GetPostOptPassManager(), &cu);
   pass_driver.Launch();
 
+  /* For non-leaf methods check if we should skip compilation when the profiler is enabled. */
+  if (cu.compiler_driver->ProfilePresent()
+      && !cu.mir_graph->MethodIsLeaf()
+      && cu.mir_graph->SkipCompilationByName(PrettyMethod(method_idx, dex_file))) {
+    cu.EndTiming();
+    return nullptr;
+  }
+
   if (cu.enable_debug & (1 << kDebugDumpCheckStats)) {
     cu.mir_graph->DumpCheckStats();
   }