diff options
author | Googler <noreply@google.com> | 2018-05-16 17:26:26 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-16 17:27:54 -0700 |
commit | cc0f41dccc55bb1380b10cc65281632676192a8d (patch) | |
tree | dee53a4fd2c139e15e0f13d87b23d51a3de23953 /src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java | |
parent | c251ead49b1689984f32832047529e5469674c69 (diff) |
Build support for passing a software cache prefetching hints file.
This flag assumes llvm supports an experimental 'prefetch-hints-flag' flag. The Bazel support simply plumbs the provided file through to the compiler.
The flag is independent from the other fdo_ flags, and may be applied in any combination with them.
RELNOTES: Introduce build support for providing cache prefetch hints.
PiperOrigin-RevId: 196916547
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java index df6dba73d0..f3e6d688a9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java @@ -230,10 +230,18 @@ public final class LtoBackendArtifacts { // The input to the LTO backend step is the bitcode file. buildVariablesBuilder.addStringVariable( "thinlto_input_bitcode_file", bitcodeFile.getExecPath().toString()); - Artifact autoFdoProfile = fdoSupport.getFdoSupport().buildProfileForLtoBackend( - fdoSupport, featureConfiguration, buildVariablesBuilder, ruleContext); - if (autoFdoProfile != null) { - builder.addInput(autoFdoProfile); + ProfileArtifacts profileArtifacts = + Preconditions.checkNotNull( + fdoSupport + .getFdoSupport() + .buildProfileForLtoBackend( + fdoSupport, featureConfiguration, buildVariablesBuilder, ruleContext)); + + if (profileArtifacts.getProfileArtifact() != null) { + builder.addInput(profileArtifacts.getProfileArtifact()); + } + if (profileArtifacts.getPrefetchHintsArtifact() != null) { + builder.addInput(profileArtifacts.getPrefetchHintsArtifact()); } if (generateDwo) { |