From 63086d7af080c4483c71fd5020263f0d91fe9f2b Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Tue, 28 Feb 2023 15:13:44 +0000 Subject: [PATCH] Omit "--compiler-filter" if the profile is disabled. This fixes the Golem regression caused by aosp/2453067. On Golem, the profile disabled and dex2oat uses the default "speed" compiler filter. Bug: 269230245 Test: art/tools/golem/build-target.sh --machine-type=android-armv8 --golem=art-interpreter Change-Id: I4fc0dbf9eac8839f7bacd264ddab177956ddd58e --- java/dexpreopt_bootjars.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index f2079b05d..6140e1142 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -760,8 +760,13 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p FlagWithArg("--android-root=", global.EmptyDirectory). FlagWithArg("--no-inline-from=", "core-oj.jar"). Flag("--force-determinism"). - Flag("--abort-on-hard-verifier-error"). - FlagWithArg("--compiler-filter=", image.compilerFilter) + Flag("--abort-on-hard-verifier-error") + + // If the image is profile-guided but the profile is disabled, we omit "--compiler-filter" to + // leave the decision to dex2oat to pick the compiler filter. + if !(image.isProfileGuided() && global.DisableGenerateProfile) { + cmd.FlagWithArg("--compiler-filter=", image.compilerFilter) + } // Use the default variant/features for host builds. // The map below contains only device CPU info (which might be x86 on some devices).