Make dex2oat support profiles passed to non profile filters

Using a non profile filter with an input profile should compile
everything but generate an app image and optimize layout based on
the profile.

Change UseProfileGuidedCompilation to use the profile arguments.
Using profile arguments instead of being based on the compiler
filter lets us do full speed compile and layout based on profile.

Fix ShouldCompileBasedOnProfile to use the compiler filter instead
of the existence of a profile.

Fixed gtests.

Test: test-art-host

Bug: 34927277

Change-Id: I325a10d2072ed427bb32f96e4efa54cf81e94ad3
diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc
index 69c6151..5167869 100644
--- a/runtime/dexopt_test.cc
+++ b/runtime/dexopt_test.cc
@@ -70,6 +70,11 @@
   // rather than use this flag.
   args.push_back("-Xnorelocate");
 
+  ScratchFile profile_file;
+  if (CompilerFilter::DependsOnProfile(filter)) {
+    args.push_back("--profile-file=" + profile_file.GetFilename());
+  }
+
   if (pic) {
     args.push_back("--compile-pic");
   }