Remove absolute_path from FDO rules

Simplify the rules.

PiperOrigin-RevId: 627662346
Change-Id: I8aaf6695c518c63d2a729f76abec293d8b6c47cd
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
index e80cf48..25b5ee5 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
@@ -44,6 +44,14 @@
   @SuppressWarnings("deprecation") // These fields have no JavaDoc by design
   public static class BuildGraveyardOptions extends OptionsBase {
     @Option(
+        name = "enable_fdo_profile_absolute_path",
+        defaultValue = "true",
+        documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+        effectTags = {OptionEffectTag.NO_OP},
+        help = "Deprecated. No-op.")
+    public boolean enableFdoProfileAbsolutePath;
+
+    @Option(
         name = "incompatible_disallow_unsound_directory_outputs",
         defaultValue = "true",
         documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
index b251d42..b789bbf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -709,15 +709,6 @@
     return cppOptions.getMemProfProfileLabel();
   }
 
-  @StarlarkMethod(
-      name = "enable_fdo_profile_absolute_path",
-      documented = false,
-      useStarlarkThread = true)
-  public boolean isFdoAbsolutePathEnabledForStarlark(StarlarkThread thread) throws EvalException {
-    CcModule.checkPrivateStarlarkificationAllowlist(thread);
-    return cppOptions.enableFdoProfileAbsolutePath;
-  }
-
   public boolean useLLVMCoverageMapFormat() {
     return cppOptions.useLLVMCoverageMapFormat;
   }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
index 1160164..aa45372 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -460,14 +460,6 @@
   public Label csFdoProfileLabel;
 
   @Option(
-      name = "enable_fdo_profile_absolute_path",
-      defaultValue = "true",
-      documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
-      effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
-      help = "If set, use of fdo_absolute_profile_path will raise an error.")
-  public boolean enableFdoProfileAbsolutePath;
-
-  @Option(
       name = "propeller_optimize_absolute_cc_profile",
       defaultValue = "null",
       documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
diff --git a/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_prefetch_hints.bzl b/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_prefetch_hints.bzl
index 3d29276..6696b7b 100644
--- a/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_prefetch_hints.bzl
+++ b/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_prefetch_hints.bzl
@@ -14,31 +14,18 @@
 
 """Starlark implementation of fdo_prefetch_hints rule."""
 
-load(":common/paths.bzl", "paths")
-
 FdoPrefetchHintsInfo = provider(
     doc = "Contains the profile used for prefetch hints",
-    fields = ["artifact", "absolute_path"],
+    fields = ["artifact"],
 )
 
 def _impl(ctx):
-    if bool(ctx.file.profile) == bool(ctx.attr.absolute_path_profile):
-        fail("exactly one of profile and absolute_path_profile should be specified")
-
-    if ctx.attr.profile:
-        return FdoPrefetchHintsInfo(artifact = ctx.file.profile)
-    else:
-        if not ctx.fragments.cpp.enable_fdo_profile_absolute_path():
-            fail("absolute_path_profile cannot be used when --enable_fdo_profile_absolute_path is false")
-        if not paths.is_absolute(ctx.attr.absolute_path_profile):
-            fail("Attribute: absolute_path_profile: %s is not an absolute path" % ctx.attr.absolute_path_profile)
-        return FdoPrefetchHintsInfo(absolute_path = ctx.attr.absolute_path_profile)
+    return FdoPrefetchHintsInfo(artifact = ctx.file.profile)
 
 fdo_prefetch_hints = rule(
     implementation = _impl,
     doc = """
-<p>Represents an FDO prefetch hints profile that is either in the workspace or at a specified
-absolute path.
+<p>Represents an FDO prefetch hints profile that is either in the workspace.
 Examples:</p>
 
 <pre><code class="lang-starlark">
@@ -46,24 +33,15 @@
     name = "hints",
     profile = "//path/to/hints:profile.afdo",
 )
-
-fdo_profile(
-  name = "hints_abs",
-  absolute_path_profile = "/absolute/path/profile.afdo",
-)
 </code></pre>""",
     attrs = {
         "profile": attr.label(
             allow_single_file = [".afdo"],
+            mandatory = True,
             doc = """
 Label of the hints profile. The hints file has the .afdo extension
 The label can also point to an fdo_absolute_path_profile rule.""",
         ),
-        "absolute_path_profile": attr.string(
-            doc = """
-Absolute path to the FDO profile. The FDO file may only have the .afdo extension.""",
-        ),
     },
     provides = [FdoPrefetchHintsInfo],
-    fragments = ["cpp"],
 )
diff --git a/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_profile.bzl b/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_profile.bzl
index 97dd51c..ca8fdfe 100644
--- a/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_profile.bzl
+++ b/src/main/starlark/builtins_bzl/common/cc/fdo/fdo_profile.bzl
@@ -14,74 +14,48 @@
 
 """Starlark implementation of fdo_profile rule."""
 
-load(":common/paths.bzl", "paths")
-
 FdoProfileInfo = provider(
     doc = "Contains the profile used for FDO",
     fields = ["artifact", "absolute_path", "proto_profile_artifact", "memprof_artifact"],
 )
 
 def _impl(ctx):
-    # proto_profile and memprof_profile can only be used if at least one of profile and
-    # absolute_path_profile are provided.
-    if bool(ctx.file.profile) == bool(ctx.attr.absolute_path_profile):
-        fail("exactly one of profile and absolute_path_profile should be specified")
+    # proto_profile and memprof_profile can only be used if at least one of profile
+    # are provided.
     if ctx.file.proto_profile and not ctx.file.proto_profile.is_source:
         fail("Attribute proto_profile: the target is not an input file")
     if ctx.file.memprof_profile and not ctx.file.memprof_profile.is_source:
         fail("Attribute memprof_profile: the target is not an input file")
 
-    if ctx.attr.profile:
-        return FdoProfileInfo(
-            artifact = ctx.file.profile,
-            proto_profile_artifact = ctx.file.proto_profile,
-            memprof_artifact = ctx.file.memprof_profile,
-        )
-    else:
-        if not ctx.fragments.cpp.enable_fdo_profile_absolute_path():
-            fail("this attribute cannot be used when --enable_fdo_profile_absolute_path is false")
-        absolute_path_profile = ctx.expand_make_variables("absolute_path_profile", ctx.attr.absolute_path_profile, {})
-        if not paths.is_absolute(absolute_path_profile):
-            fail("Attribute: absolute_path_profile: %s is not an absolute path" % ctx.attr.absolute_path_profile)
-        return FdoProfileInfo(
-            absolute_path = absolute_path_profile,
-            proto_profile_artifact = ctx.file.proto_profile,
-            memprof_artifact = ctx.file.memprof_profile,
-        )
+    return FdoProfileInfo(
+        artifact = ctx.file.profile,
+        proto_profile_artifact = ctx.file.proto_profile,
+        memprof_artifact = ctx.file.memprof_profile,
+    )
 
 fdo_profile = rule(
     implementation = _impl,
     doc = """
 
-<p>Represents an FDO profile that is either in the workspace or at a specified absolute path.
-Examples:</p>
+<p>Represents an FDO profile that is in the workspace.
+Example:</p>
 
 <pre><code class="lang-starlark">
 fdo_profile(
     name = "fdo",
     profile = "//path/to/fdo:profile.zip",
 )
-
-fdo_profile(
-  name = "fdo_abs",
-  absolute_path_profile = "/absolute/path/profile.zip",
-)
 </code></pre>""",
     attrs = {
         "profile": attr.label(
             allow_single_file = [".profraw", ".profdata", ".zip", ".afdo", ".xfdo"],
+            mandatory = True,
             doc = """
 Label of the FDO profile or a rule which generates it. The FDO file can have one of the
 following extensions: .profraw for unindexed LLVM profile, .profdata for indexed LLVM
 profile, .zip that holds an LLVM profraw profile, .afdo for AutoFDO profile, .xfdo for
 XBinary profile. The label can also point to an fdo_absolute_path_profile rule.""",
         ),
-        "absolute_path_profile": attr.string(
-            doc = """
-Absolute path to the FDO profile. The FDO file can have one of the following extensions:
-.profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip
-that holds an LLVM profraw profile, or .afdo for AutoFDO profile.""",
-        ),
         "proto_profile": attr.label(allow_single_file = True, doc = """
 Label of the protobuf profile."""),
         "memprof_profile": attr.label(allow_single_file = [".profdata", ".zip"], doc = """
@@ -91,5 +65,4 @@
 file."""),
     },
     provides = [FdoProfileInfo],
-    fragments = ["cpp"],
 )
diff --git a/src/main/starlark/builtins_bzl/common/cc/fdo/memprof_profile.bzl b/src/main/starlark/builtins_bzl/common/cc/fdo/memprof_profile.bzl
index 7cf3ef4..a2489f0 100644
--- a/src/main/starlark/builtins_bzl/common/cc/fdo/memprof_profile.bzl
+++ b/src/main/starlark/builtins_bzl/common/cc/fdo/memprof_profile.bzl
@@ -14,32 +14,19 @@
 
 """Starlark implementation of memprof_profile rule."""
 
-load(":common/paths.bzl", "paths")
-
 MemProfProfileInfo = provider(
     doc = "Contains the memprof profile",
-    fields = ["artifact", "absolute_path"],
+    fields = ["artifact"],
 )
 
 def _impl(ctx):
-    if bool(ctx.file.profile) == bool(ctx.attr.absolute_path_profile):
-        fail("exactly one of profile and absolute_path_profile should be specified")
-
-    if ctx.attr.profile:
-        return MemProfProfileInfo(artifact = ctx.file.profile)
-    else:
-        if not ctx.fragments.cpp.enable_fdo_profile_absolute_path():
-            fail("absolute_path_profile cannot be used when --enable_fdo_profile_absolute_path is false")
-        if not paths.is_absolute(ctx.attr.absolute_path_profile):
-            fail("Attribute: absolute_path_profile: %s is not an absolute path" % ctx.attr.absolute_path_profile)
-        return MemProfProfileInfo(absolute_path = ctx.attr.absolute_path_profile)
+    return MemProfProfileInfo(artifact = ctx.file.profile)
 
 memprof_profile = rule(
     implementation = _impl,
     doc = """
-<p>Represents a MEMPROF profile that is either in the workspace or at a specified
-absolute path.
-Examples:</p>
+<p>Represents a MEMPROF profile that is in the workspace.
+Example:</p>
 
 <pre><code class="lang-starlark">
 memprof_profile(
@@ -47,14 +34,11 @@
     profile = "//path/to/memprof:profile.afdo",
 )
 
-memprof_profile(
-  name = "memprof_abs",
-  absolute_path_profile = "/absolute/path/profile.afdo",
-)
 </code></pre>""",
     attrs = {
         "profile": attr.label(
             allow_single_file = [".profdata", ".zip"],
+            mandatory = True,
             doc = """
 Label of the MEMPROF profile. The profile is expected to have
 either a .profdata extension (for an indexed/symbolized memprof
@@ -62,12 +46,6 @@
 file.
 The label can also point to an fdo_absolute_path_profile rule.""",
         ),
-        "absolute_path_profile": attr.string(
-            doc = """
-Absolute path to the MEMPROF profile. The file may only have a .profdata or
-.zip extension (where the zipfile must contain a memprof.profdata file).""",
-        ),
     },
     provides = [MemProfProfileInfo],
-    fragments = ["cpp"],
 )
diff --git a/src/main/starlark/builtins_bzl/common/cc/fdo/propeller_optimize.bzl b/src/main/starlark/builtins_bzl/common/cc/fdo/propeller_optimize.bzl
index 9d1b44b..3e3e8ce 100644
--- a/src/main/starlark/builtins_bzl/common/cc/fdo/propeller_optimize.bzl
+++ b/src/main/starlark/builtins_bzl/common/cc/fdo/propeller_optimize.bzl
@@ -14,50 +14,16 @@
 
 """Starlark implementation of propeller_optimize rule."""
 
-load(":common/paths.bzl", "paths")
-
 PropellerOptimizeInfo = provider(
     doc = "Contains the profile used for propeller",
     fields = ["cc_profile", "ld_profile"],
 )
 
 def _impl(ctx):
-    if ctx.file.cc_profile and ctx.attr.absolute_cc_profile:
-        fail("Attribute cc_profile: Both relative and absolute profiles are provided.")
-    if ctx.file.ld_profile and ctx.attr.absolute_ld_profile:
-        fail("Attribute ld_profile: Both relative and absolute profiles are provided.")
-
-    cc_profile = None
-    if ctx.file.cc_profile:
-        cc_profile = ctx.file.cc_profile
-    if ctx.attr.absolute_cc_profile:
-        if not ctx.fragments.cpp.enable_fdo_profile_absolute_path():
-            fail("absolute paths cannot be used when --enable_fdo_profile_absolute_path is false")
-        if not paths.is_absolute(ctx.attr.absolute_cc_profile):
-            fail("Attribute: cc_profile: %s is not an absolute path" % ctx.attr.absolute_cc_profile)
-        cc_profile = ctx.actions.declare_symlink(ctx.label.name + "/" + paths.basename(ctx.attr.absolute_cc_profile))
-        ctx.actions.symlink(
-            target_path = ctx.attr.absolute_cc_profile,
-            output = cc_profile,
-            progress_message = "Symlinking LLVM Propeller Profile " + ctx.attr.absolute_cc_profile,
-        )
-
-    ld_profile = None
-    if ctx.file.ld_profile:
-        ld_profile = ctx.file.ld_profile
-    if ctx.attr.absolute_ld_profile:
-        if not ctx.fragments.cpp.enable_fdo_profile_absolute_path():
-            fail("absolute paths cannot be used when --enable_fdo_profile_absolute_path is false")
-        if not paths.is_absolute(ctx.attr.absolute_ld_profile):
-            fail("Attribute: ld_profile: %s is not an absolute path" % ctx.attr.absolute_ld_profile)
-        ld_profile = ctx.actions.declare_symlink(ctx.label.name + "/" + paths.basename(ctx.attr.absolute_ld_profile))
-        ctx.actions.symlink(
-            target_path = ctx.attr.absolute_ld_profile,
-            output = ld_profile,
-            progress_message = "Symlinking LLVM Propeller Profile " + ctx.attr.absolute_ld_profile,
-        )
-
-    return PropellerOptimizeInfo(cc_profile = cc_profile, ld_profile = ld_profile)
+    return PropellerOptimizeInfo(
+        cc_profile = ctx.file.cc_profile,
+        ld_profile = ctx.file.ld_profile,
+    )
 
 propeller_optimize = rule(
     implementation = _impl,
@@ -71,37 +37,22 @@
     cc_profile = "//path:cc_profile.txt",
     ld_profile = "//path:ld_profile.txt"
 )
-
-propeller_optimize(
-    name = "layout_absolute",
-    absolute_cc_profile = "/absolute/cc_profile.txt",
-    absolute_ld_profile = "/absolute/ld_profile.txt"
-)
 </code></pre>""",
     attrs = {
         "cc_profile": attr.label(
             allow_single_file = [".txt"],
+            mandatory = True,
             doc = """
 Label of the profile passed to the various compile actions.  This file has
 the .txt extension.""",
         ),
         "ld_profile": attr.label(
             allow_single_file = [".txt"],
+            mandatory = True,
             doc = """
 Label of the profile passed to the link action.  This file has
 the .txt extension.""",
         ),
-        "absolute_cc_profile": attr.string(
-            doc = """
-Label of the absolute profile passed to the various compile actions.  This file has
-the .txt extension.""",
-        ),
-        "absolute_ld_profile": attr.string(
-            doc = """
-Label of the absolute profile passed to the various link actions.  This file has
-the .txt extension.""",
-        ),
     },
     provides = [PropellerOptimizeInfo],
-    fragments = ["cpp"],
 )
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoObjDirTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoObjDirTest.java
index 513e72f..8e17e71 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoObjDirTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoObjDirTest.java
@@ -2091,23 +2091,14 @@
         .doesNotContainMatch("-fbasic-block-sections=");
   }
 
-  private void testPropellerOptimizeOption(boolean label) throws Exception {
+  @Test
+  public void testPropellerOptimizeOptionFromLabel() throws Exception {
     createBuildFiles();
-
-    if (label) {
-      scratch.file(
-          "fdo/BUILD",
-          "propeller_optimize(name='test_propeller_optimize', cc_profile=':cc_profile.txt',"
-              + " ld_profile=':ld_profile.txt')");
-    } else {
-      scratch.file(
-          "fdo/BUILD",
-          "propeller_optimize(name='test_propeller_optimize',"
-              + "absolute_cc_profile='/tmp/cc_profile.txt',"
-              + "absolute_ld_profile='/tmp/ld_profile.txt')");
-    }
+    scratch.file(
+        "fdo/BUILD",
+        "propeller_optimize(name='test_propeller_optimize', cc_profile=':cc_profile.txt',"
+            + " ld_profile=':ld_profile.txt')");
     setupThinLTOCrosstool(CppRuleClasses.SUPPORTS_PIC, CppRuleClasses.AUTOFDO);
-
     useConfiguration(
         "--propeller_optimize=//fdo:test_propeller_optimize", "--compilation_mode=opt");
 
@@ -2136,27 +2127,9 @@
         .contains("cc_profile.txt");
   }
 
-  @Test
-  public void testPropellerOptimizeOptionFromAbsolutePath() throws Exception {
-    testPropellerOptimizeOption(false);
-  }
-
-  @Test
-  public void testPropellerOptimizeOptionFromLabel() throws Exception {
-    testPropellerOptimizeOption(true);
-  }
-
-  private void testLLVMCachePrefetchBackendOption(String extraOption, boolean asLabel)
-      throws Exception {
+  private void testLLVMCachePrefetchBackendOption(String extraOption) throws Exception {
     createBuildFiles();
-    if (asLabel) {
-      scratch.file(
-          "fdo/BUILD", "fdo_prefetch_hints(name='test_profile', profile=':prefetch.afdo')");
-    } else {
-      scratch.file(
-          "fdo/BUILD",
-          "fdo_prefetch_hints(name='test_profile', absolute_path_profile='/tmp/prefetch.afdo')");
-    }
+    scratch.file("fdo/BUILD", "fdo_prefetch_hints(name='test_profile', profile=':prefetch.afdo')");
 
     setupThinLTOCrosstool(CppRuleClasses.SUPPORTS_PIC, CppRuleClasses.AUTOFDO);
     useConfiguration(
@@ -2166,33 +2139,20 @@
     LtoBackendAction backendAction =
         getBackendAction("pkg/bin.lto-obj/" + rootExecPath + "/pkg/_objs/bin/binfile.o");
 
-    String expectedCompilerFlag =
-        "-prefetch-hints-file="
-            + (asLabel ? ".*/prefetch.afdo" : "(blaze|bazel)-out/.*/fdo/.*/prefetch.afdo");
     assertThat(Joiner.on(" ").join(backendAction.getArguments()))
-        .containsMatch("-mllvm " + expectedCompilerFlag);
+        .containsMatch("-mllvm -prefetch-hints-file=.*/prefetch.afdo");
 
     assertThat(ActionsTestUtil.baseArtifactNames(backendAction.getInputs()))
         .contains("prefetch.afdo");
   }
 
   @Test
-  public void testFdoCachePrefetchLLVMOptionsToBackendFromPath() throws Exception {
-    testLLVMCachePrefetchBackendOption("", false);
-  }
-
-  @Test
-  public void testFdoCachePrefetchAndFdoLLVMOptionsToBackendFromPath() throws Exception {
-    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip", false);
-  }
-
-  @Test
   public void testFdoCachePrefetchLLVMOptionsToBackendFromLabel() throws Exception {
-    testLLVMCachePrefetchBackendOption("", true);
+    testLLVMCachePrefetchBackendOption("");
   }
 
   @Test
   public void testFdoCachePrefetchAndFdoLLVMOptionsToBackendFromLabel() throws Exception {
-    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip", true);
+    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip");
   }
 }
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoTest.java
index e8a6394..339bf21 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBinaryThinLtoTest.java
@@ -2049,23 +2049,14 @@
         .doesNotContainMatch("-fbasic-block-sections=");
   }
 
-  private void testPropellerOptimizeOption(boolean label) throws Exception {
+  @Test
+  public void testPropellerOptimizeOptionFromLabel() throws Exception {
     createBuildFiles();
-
-    if (label) {
-      scratch.file(
-          "fdo/BUILD",
-          "propeller_optimize(name='test_propeller_optimize', cc_profile=':cc_profile.txt',"
-              + " ld_profile=':ld_profile.txt')");
-    } else {
-      scratch.file(
-          "fdo/BUILD",
-          "propeller_optimize(name='test_propeller_optimize',"
-              + "absolute_cc_profile='/tmp/cc_profile.txt',"
-              + "absolute_ld_profile='/tmp/ld_profile.txt')");
-    }
+    scratch.file(
+        "fdo/BUILD",
+        "propeller_optimize(name='test_propeller_optimize', cc_profile=':cc_profile.txt',"
+            + " ld_profile=':ld_profile.txt')");
     setupThinLTOCrosstool(CppRuleClasses.SUPPORTS_PIC, CppRuleClasses.AUTOFDO);
-
     useConfiguration(
         "--propeller_optimize=//fdo:test_propeller_optimize", "--compilation_mode=opt");
 
@@ -2094,27 +2085,9 @@
         .contains("cc_profile.txt");
   }
 
-  @Test
-  public void testPropellerOptimizeOptionFromAbsolutePath() throws Exception {
-    testPropellerOptimizeOption(false);
-  }
-
-  @Test
-  public void testPropellerOptimizeOptionFromLabel() throws Exception {
-    testPropellerOptimizeOption(true);
-  }
-
-  private void testLLVMCachePrefetchBackendOption(String extraOption, boolean asLabel)
-      throws Exception {
+  private void testLLVMCachePrefetchBackendOption(String extraOption) throws Exception {
     createBuildFiles();
-    if (asLabel) {
-      scratch.file(
-          "fdo/BUILD", "fdo_prefetch_hints(name='test_profile', profile=':prefetch.afdo')");
-    } else {
-      scratch.file(
-          "fdo/BUILD",
-          "fdo_prefetch_hints(name='test_profile', absolute_path_profile='/tmp/prefetch.afdo')");
-    }
+    scratch.file("fdo/BUILD", "fdo_prefetch_hints(name='test_profile', profile=':prefetch.afdo')");
 
     setupThinLTOCrosstool(CppRuleClasses.SUPPORTS_PIC, CppRuleClasses.AUTOFDO);
     useConfiguration(
@@ -2124,34 +2097,21 @@
     LtoBackendAction backendAction =
         getBackendAction("pkg/bin.lto/" + rootExecPath + "/pkg/_objs/bin/binfile.o");
 
-    String expectedCompilerFlag =
-        "-prefetch-hints-file="
-            + (asLabel ? ".*/prefetch.afdo" : "(blaze|bazel)-out/.*/fdo/.*/prefetch.afdo");
     assertThat(Joiner.on(" ").join(backendAction.getArguments()))
-        .containsMatch("-mllvm " + expectedCompilerFlag);
+        .containsMatch("-mllvm -prefetch-hints-file=.*/prefetch.afdo");
 
     assertThat(ActionsTestUtil.baseArtifactNames(backendAction.getInputs()))
         .contains("prefetch.afdo");
   }
 
   @Test
-  public void testFdoCachePrefetchLLVMOptionsToBackendFromPath() throws Exception {
-    testLLVMCachePrefetchBackendOption("", false);
-  }
-
-  @Test
-  public void testFdoCachePrefetchAndFdoLLVMOptionsToBackendFromPath() throws Exception {
-    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip", false);
-  }
-
-  @Test
   public void testFdoCachePrefetchLLVMOptionsToBackendFromLabel() throws Exception {
-    testLLVMCachePrefetchBackendOption("", true);
+    testLLVMCachePrefetchBackendOption("");
   }
 
   @Test
   public void testFdoCachePrefetchAndFdoLLVMOptionsToBackendFromLabel() throws Exception {
-    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip", true);
+    testLLVMCachePrefetchBackendOption("--fdo_optimize=/profile.zip");
   }
 
   @Test