[all-commits] [llvm/llvm-project] de754b: [MLIR][ROCm] Build mlir_rocm_runtime STANDALONE (#...

Umang Yadav via All-commits all-commits at lists.llvm.org
Mon Jul 13 11:04:37 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de754b87a6c57b7d5ebb4cbd0fd9ef0c8ba7512d
      https://github.com/llvm/llvm-project/commit/de754b87a6c57b7d5ebb4cbd0fd9ef0c8ba7512d
  Author: Umang Yadav <29876643+umangyadav at users.noreply.github.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M mlir/lib/ExecutionEngine/CMakeLists.txt
    M mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp

  Log Message:
  -----------
  [MLIR][ROCm] Build mlir_rocm_runtime STANDALONE (#205651)

Build `mlir_rocm_runtime` as a standalone runtime library by removing
its last
source-level dependency on LLVM support utilities.

`mlir_rocm_runtime` is intended to be loaded dynamically by tools such
as
`mlir-runner` via `--shared-libs`. However, `add_mlir_library` links
`LLVMSupport` by default unless the target is marked `STANDALONE`. The
ROCm
runtime was previously left on `DISABLE_PCH_REUSE` as a workaround
because
`RocmRuntimeWrappers.cpp` still used `llvm::SmallVector` and
`llvm::ArrayRef`
inside `mgpuMemHostRegisterMemRef`.

This patch replaces that small LLVM ADT use with equivalent plain C++
logic and
marks `mlir_rocm_runtime` `STANDALONE`, matching the CUDA runtime.

## Motivation

This follows the direction from prior upstream changes:

-
[`4edc9e2acf1d`](https://github.com/llvm/llvm-project/commit/4edc9e2acf1d9350ce4da77c93e8869f774a24e2)
/
[D108684](https://reviews.llvm.org/D108684), by Uday Bondhugula, removed
the
  same `SmallVector`/`ArrayRef` dependency from CUDA's
`mgpuMemHostRegisterMemRef`, noting that the dependency on `LLVMSupport`
adds
unnecessary complexity for external users linking or loading the
runtime.
-
[`351ae0ca550c`](https://github.com/llvm/llvm-project/commit/351ae0ca550c791b0c504dfb7dcb4fd08480d98b)
/
[#182850](https://github.com/llvm/llvm-project/pull/182850) made several
  dlopen-able MLIR runtime libraries `STANDALONE`, including
`mlir_cuda_runtime`, and left `mlir_rocm_runtime` on `DISABLE_PCH_REUSE`
only
  because it still depended on `LLVMSupport`.
-
[`78f259fcc14b`](https://github.com/llvm/llvm-project/commit/78f259fcc14bb0a567d45ba394fcde48de2bc299)
/
[#182942](https://github.com/llvm/llvm-project/pull/182942) applied the
same
cleanup pattern to `mlir_levelzero_runtime` by removing a small
remaining LLVM
  dependency and marking the runtime `STANDALONE`.

With the remaining LLVM ADT use removed from the ROCm wrapper, the
workaround is
no longer needed.

## Testing

Verified and tested downstream in rocMLIR.

No new upstream test is added. This is a build/linkage cleanup for a
runtime
library that is already exercised by the ROCm integration tests when
`MLIR_ENABLE_ROCM_RUNNER` is enabled.

The rewritten dense-stride computation in `mgpuMemHostRegisterMemRef` is
equivalent to the previous implementation and matches the existing CUDA
runtime
implementation.

## AI Assistance Disclosure

Assisted-by: GPT-5.5

I reviewed the generated content and verified the changes before
submitting,
including testing them downstream in rocMLIR.

---------

Co-authored-by: Cursor <cursoragent at cursor.com>



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