diff options
author | 2018-05-17 13:07:38 -0700 | |
---|---|---|
committer | 2018-05-17 13:09:00 -0700 | |
commit | 128c874999eb3f313a992e95d6ab94e557ff7e81 (patch) | |
tree | 03dfbb244eb099a28b3f951173ea00ff0d74300f /src/test/java/com/google/devtools/build/lib | |
parent | 5649d58296c0c1bc0213c1b92b51934b06ca3605 (diff) |
Support for ThinLTO to be enabled implicitly with FDO
Allows for ThinLTO to be enabled once the --features=fdo_implicit_thinlto feature is enabled in the crosstool. Also allows for --features=-thin_lto to override and prevent ThinLTO from being enabled.
This is essentially the same as https://github.com/bazelbuild/bazel/commit/8e3afccd8bea45105752ddeb33bde111c556fb8b but for instrumentation FDO
instead of AFDO.
RELNOTES: None.
PiperOrigin-RevId: 197038710
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java index a3eaeb072b..64ed3c068d 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java @@ -379,6 +379,17 @@ public abstract class MockCcSupport { public static final String AUTOFDO_IMPLICIT_THINLTO_CONFIGURATION = "" + "feature { name: 'autofdo_implicit_thinlto'}"; + public static final String ENABLE_FDO_THINLTO_CONFIGURATION = + "" + + "feature {" + + " name: 'enable_fdo_thinlto'" + + " requires { feature: 'fdo_implicit_thinlto' }" + + " implies: 'thin_lto'" + + "}"; + + public static final String FDO_IMPLICIT_THINLTO_CONFIGURATION = + "" + "feature { name: 'fdo_implicit_thinlto'}"; + public static final String AUTO_FDO_CONFIGURATION = "" + "feature {" @@ -396,6 +407,25 @@ public abstract class MockCcSupport { + " }" + "}"; + public static final String FDO_OPTIMIZE_CONFIGURATION = + "" + + "feature {" + + " name: 'fdo_optimize'" + + " provides: 'profile'" + + " flag_set {" + + " action: 'c-compile'" + + " action: 'c++-compile'" + + " expand_if_all_available: 'fdo_profile_path'" + + " flag_group {" + + " flag: '-fprofile-use=%{fdo_profile_path}'" + + " flag: '-Xclang-only=-Wno-profile-instr-unprofiled'" + + " flag: '-Xclang-only=-Wno-profile-instr-out-of-date'" + + " flag: '-Xclang-only=-Wno-backend-plugin'" + + " flag: '-fprofile-correction'" + + " }" + + " }" + + "}"; + public static final String FDO_INSTRUMENT_CONFIGURATION = "" + "feature { " |