[PATCH] D117752: [MLGO] Improved support for AOT cross-targeting scenarios

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 23:08:01 PST 2022


mtrofin created this revision.
mtrofin added a reviewer: phosek.
Herald added subscribers: hiraditya, kristof.beyls, mgorny, qcolombet, MatzeB.
mtrofin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The tensorflow AOT compiler can cross-target, but it can't run on (for
example) arm64. We added earlier support where the AOT-ed header and object
would be built on a separate builder and then passed at build time to
a build host where the AOT compiler can't run, but clang can be otherwise
built.

To simplify such scenarios given we now support more than one AOT-able
case (regalloc and inliner), we make the AOT scenario centered on whether
files are generated, case by case (this includes the "passed from a
different builder" scenario).
This means we shouldn't need an 'umbrella' LLVM_HAVE_TF_AOT, in favor of
case by case control. A builder can opt out of an AOT case by passing that case's
model path as `none`. Note that the overrides still take precedence.

This patch controls conditional compilation with case-specific flags,
which can be enabled locally, for the component where those are
available. We still keep an overall flag for some tests.

The 'development/training' mode is unchanged, because there the model is
passed from the command line and interpreted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117752

Files:
  llvm/CMakeLists.txt
  llvm/cmake/modules/TensorFlowCompile.cmake
  llvm/include/llvm/Analysis/InlineAdvisor.h
  llvm/include/llvm/Config/llvm-config.h.cmake
  llvm/lib/Analysis/InlineAdvisor.cpp
  llvm/lib/Analysis/MLInlineAdvisor.cpp
  llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
  llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
  llvm/lib/CodeGen/RegAllocEvictionAdvisor.h
  llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll
  llvm/test/Transforms/Inline/ML/bounds-checks.ll
  llvm/test/Transforms/Inline/ML/ml-test-release-mode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117752.401520.patch
Type: text/x-patch
Size: 14502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220120/0223868e/attachment.bin>


More information about the llvm-commits mailing list