[llvm] [mlgo][inliner] Fix potential concurrency issue in local ThinLTO + IR2Vec cases (PR #156120)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 17:33:44 PDT 2025


================
@@ -192,18 +193,27 @@ MLInlineAdvisor::MLInlineAdvisor(
   }
   NodeCount = AllNodes.size();
 
-  if (auto IR2VecVocabResult = MAM.getCachedResult<IR2VecVocabAnalysis>(M)) {
+  if (auto *IR2VecVocabResult = MAM.getCachedResult<IR2VecVocabAnalysis>(M)) {
     if (!IR2VecVocabResult->isValid()) {
       M.getContext().emitError("IR2VecVocabAnalysis is not valid");
       return;
     }
     // Add the IR2Vec features to the feature map
     auto IR2VecDim = IR2VecVocabResult->getDimension();
-    getFeatureMap().push_back(
+    FeatureMap.push_back(
         TensorSpec::createSpec<float>("callee_embedding", {IR2VecDim}));
-    getFeatureMap().push_back(
+    FeatureMap.push_back(
         TensorSpec::createSpec<float>("caller_embedding", {IR2VecDim}));
   }
+  if (InteractiveIncludeDefault)
----------------
mtrofin wrote:

ya, but if not, and the model doesn't have it, it's a noop (minus compiletime penalty).

https://github.com/llvm/llvm-project/pull/156120


More information about the llvm-commits mailing list