[llvm] f3b5fca - [mlgo] Fix the help message for interactive mode default advice

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 13:04:28 PDT 2023


Author: Mircea Trofin
Date: 2023-04-11T13:04:11-07:00
New Revision: f3b5fca12a1c6d24d4198dde7db6e93332a0e085

URL: https://github.com/llvm/llvm-project/commit/f3b5fca12a1c6d24d4198dde7db6e93332a0e085
DIFF: https://github.com/llvm/llvm-project/commit/f3b5fca12a1c6d24d4198dde7db6e93332a0e085.diff

LOG: [mlgo] Fix the help message for interactive mode default advice

This avoids the use-after-free introduced by D147794 and fixed
in 437dfa5b0365.

Added: 
    

Modified: 
    llvm/lib/Analysis/MLInlineAdvisor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MLInlineAdvisor.cpp b/llvm/lib/Analysis/MLInlineAdvisor.cpp
index f977648595389..49d5deea8fc91 100644
--- a/llvm/lib/Analysis/MLInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/MLInlineAdvisor.cpp
@@ -38,10 +38,13 @@ static cl::opt<std::string> InteractiveChannelBaseName(
         "Base file path for the interactive mode. The incoming filename should "
         "have the name <inliner-interactive-channel-base>.in, while the "
         "outgoing name should be <inliner-interactive-channel-base>.out"));
-static cl::opt<bool> InteractiveIncludeDefault(
-    "inliner-interactive-include-default", cl::Hidden,
-    cl::desc(
-        "In interactive mode, also send the default policy decision."));
+static const std::string InclDefaultMsg =
+    (Twine("In interactive mode, also send the default policy decision: ") +
+     DefaultDecisionName + ".")
+        .str();
+static cl::opt<bool>
+    InteractiveIncludeDefault("inliner-interactive-include-default", cl::Hidden,
+                              cl::desc(InclDefaultMsg));
 
 #if defined(LLVM_HAVE_TF_AOT_INLINERSIZEMODEL)
 // codegen-ed file


        


More information about the llvm-commits mailing list