[all-commits] [llvm/llvm-project] cc4703: [mlir][AMDGPU] Add emulation pass for atomics on A...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Wed May 3 14:19:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc4703745ffa398b66f985b483cb8b61eb2ed425
      https://github.com/llvm/llvm-project/commit/cc4703745ffa398b66f985b483cb8b61eb2ed425
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2023-05-03 (Wed, 03 May 2023)

  Changed paths:
    M mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
    R mlir/include/mlir/Conversion/AMDGPUToROCDL/Chipset.h
    R mlir/include/mlir/Dialect/AMDGPU/AMDGPU.td
    R mlir/include/mlir/Dialect/AMDGPU/AMDGPUDialect.h
    M mlir/include/mlir/Dialect/AMDGPU/CMakeLists.txt
    A mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
    A mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h
    A mlir/include/mlir/Dialect/AMDGPU/IR/CMakeLists.txt
    A mlir/include/mlir/Dialect/AMDGPU/Transforms/CMakeLists.txt
    A mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.h
    A mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.td
    A mlir/include/mlir/Dialect/AMDGPU/Utils/Chipset.h
    M mlir/include/mlir/InitAllDialects.h
    M mlir/include/mlir/InitAllPasses.h
    M mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
    M mlir/lib/Conversion/AMDGPUToROCDL/CMakeLists.txt
    R mlir/lib/Conversion/AMDGPUToROCDL/Chipset.cpp
    M mlir/lib/Dialect/AMDGPU/CMakeLists.txt
    M mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp
    A mlir/lib/Dialect/AMDGPU/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
    A mlir/lib/Dialect/AMDGPU/Utils/CMakeLists.txt
    A mlir/lib/Dialect/AMDGPU/Utils/Chipset.cpp
    A mlir/test/Dialect/AMDGPU/amdgpu-emulate-atomics.mlir

  Log Message:
  -----------
  [mlir][AMDGPU] Add emulation pass for atomics on AMDGPU targets

Not all AMDGPU targets support all atomic operations. For example,
there are not atomic floating-point adds on the gfx10 series. Add a
pass to emulate these operations using a compare-and-swap loop, by
analogy to the generic atomicrmw rewrite in MemrefToLLVM.

This pass is named generally, as in the future we may have a
memref-to-amdgpu that translates constructs like atomicrmw fmax (which
doesn't generally exist in LLVM) to the relevant intrinsics, which may
themselves require emulation.

Since the AMDGPU dialect now has a pass that operates on it, the
dialect's directory structure is reorganized to match other similarly
complex dialects.

The pass should be run before amdgpu-to-rocdl if desired.

This commit also adds f64 support to atomic_fmax.

Depends on D148722

Reviewed By: nirvedhmeshram

Differential Revision: https://reviews.llvm.org/D148724




More information about the All-commits mailing list