[all-commits] [llvm/llvm-project] 176379: [mlir] Use the interface-based translation for LLV...

ftynse via All-commits all-commits at lists.llvm.org
Mon Feb 15 05:43:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 176379e0c8f9dbde2b357fb3b6a6802b83282e71
      https://github.com/llvm/llvm-project/commit/176379e0c8f9dbde2b357fb3b6a6802b83282e71
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-02-15 (Mon, 15 Feb 2021)

  Changed paths:
    M mlir/examples/standalone/test/Standalone/standalone-translate.mlir
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/InitAllTranslations.h
    M mlir/include/mlir/Target/LLVMIR.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/LLVMAVX512/LLVMAVX512ToLLVMIRTranslation.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/LLVMArmNeon/LLVMArmNeonToLLVMIRTranslation.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/LLVMArmSVE/LLVMArmSVEToLLVMIRTranslation.h
    M mlir/include/mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h
    M mlir/include/mlir/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.h
    M mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
    M mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
    R mlir/include/mlir/Target/NVVMIR.h
    R mlir/include/mlir/Target/ROCDLIR.h
    M mlir/lib/Target/CMakeLists.txt
    M mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp
    R mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp
    R mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp
    M mlir/lib/Target/LLVMIR/Dialect/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/LLVMAVX512/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/LLVMAVX512/LLVMAVX512ToLLVMIRTranslation.cpp
    A mlir/lib/Target/LLVMIR/Dialect/LLVMArmNeon/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/LLVMArmNeon/LLVMArmNeonToLLVMIRTranslation.cpp
    A mlir/lib/Target/LLVMIR/Dialect/LLVMArmSVE/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/LLVMArmSVE/LLVMArmSVEToLLVMIRTranslation.cpp
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
    A mlir/lib/Target/LLVMIR/Dialect/NVVM/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
    A mlir/lib/Target/LLVMIR/Dialect/ROCDL/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp
    R mlir/lib/Target/LLVMIR/LLVMAVX512Intr.cpp
    R mlir/lib/Target/LLVMIR/LLVMArmNeonIntr.cpp
    R mlir/lib/Target/LLVMIR/LLVMArmSVEIntr.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Target/arm-neon.mlir
    M mlir/test/Target/arm-sve.mlir
    M mlir/test/Target/avx512.mlir
    M mlir/test/Target/nvvmir.mlir
    M mlir/test/Target/rocdl.mlir
    M mlir/test/lib/Transforms/CMakeLists.txt
    M mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
    M mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
    M mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
    M mlir/tools/mlir-rocm-runner/mlir-rocm-runner.cpp
    M mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp

  Log Message:
  -----------
  [mlir] Use the interface-based translation for LLVM "intrinsic" dialects

Port the translation of five dialects that define LLVM IR intrinsics
(LLVMAVX512, LLVMArmNeon, LLVMArmSVE, NVVM, ROCDL) to the new dialect
interface-based mechanism. This allows us to remove individual translations
that were created for each of these dialects and just use one common
MLIR-to-LLVM-IR translation that potentially supports all dialects instead,
based on what is registered and including any combination of translatable
dialects. This removal was one of the main goals of the refactoring.

To support the addition of GPU-related metadata, the translation interface is
extended with the `amendOperation` function that allows the interface
implementation to post-process any translated operation with dialect attributes
from the dialect for which the interface is implemented regardless of the
operation's dialect. This is currently applied to "kernel" functions, but can
be used to construct other metadata in dialect-specific ways without
necessarily affecting operations.

Depends On D96591, D96504

Reviewed By: nicolasvasilache

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




More information about the All-commits mailing list