[all-commits] [llvm/llvm-project] c878ba: [mlgo][inliner] Fix potential concurrency issue in...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Fri Aug 29 18:24:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c878baf1d9a259cf0788ffa1cc5c9d065adcb4c5
      https://github.com/llvm/llvm-project/commit/c878baf1d9a259cf0788ffa1cc5c9d065adcb4c5
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2025-08-29 (Fri, 29 Aug 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
    M llvm/include/llvm/Analysis/MLInlineAdvisor.h
    M llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
    M llvm/lib/Analysis/MLInlineAdvisor.cpp

  Log Message:
  -----------
  [mlgo][inliner] Fix potential concurrency issue in local ThinLTO + IR2Vec cases (#156120)

The inliner's `FeatureMap` used to be immutable, but in IR2Vec cases we
don't know the shapes of the embedding vectors until later, so we need
to initialize it at the time we construct the advisor. In
non-distributed ThinLTO cases, for example, this means we'd mutate
shared state.

The feature set is also needed when constructing the underlying model
runner.

The alternative here is to postpone the creation of the model runner to
the time we construct the advisor, and also make the feature map a
member of the advisor object.

(issue identified by @efriedma-quic in PR #154541)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list