[all-commits] [llvm/llvm-project] 2366a4: [mlir] initial support for opaque pointers in the ...

ftynse via All-commits all-commits at lists.llvm.org
Thu Apr 14 04:23:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2366a43b3c50be09f70ba4bd795d95349ab90908
      https://github.com/llvm/llvm-project/commit/2366a43b3c50be09f70ba4bd795d95349ab90908
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M mlir/docs/Dialects/LLVM.md
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
    M mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
    M mlir/lib/Target/LLVMIR/TypeToLLVM.cpp
    M mlir/test/Dialect/LLVMIR/invalid.mlir
    A mlir/test/Dialect/LLVMIR/opaque-ptr.mlir
    M mlir/test/Dialect/LLVMIR/types.mlir
    A mlir/test/Target/LLVMIR/opaque-ptr.mlir

  Log Message:
  -----------
  [mlir] initial support for opaque pointers in the LLVM dialect

LLVM IR has introduced and is moving forward with the concept of opaque
pointers, i.e. pointer types that are not carrying around the pointee type.
Instead, memory-related operations indicate the type of the data being accessed
through the opaque pointer. Introduce the initial support for opaque pointers
in the LLVM dialect:

  - `LLVMPointerType` to support omitting the element type;
  - alloca/load/store/gep to support opaque pointers in their operands and
    results; this requires alloca and gep to store the element type as an
    attribute;
  - memory-related intrinsics to support opaque pointers in their operands;
  - translation to LLVM IR for the ops above is no longer using methods
    deprecated in LLVM API due to the introduction of opaque pointers.

Unlike LLVM IR, MLIR can afford to support both opaque and non-opaque pointers
at the same time and simplify the transition. Translation to LLVM IR of MLIR
that involves opaque pointers requires the LLVMContext to be configured to
always use opaque pointers.

Reviewed By: wsmoses

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


  Commit: 09141f1adf2dd400e0104e87270f7b7fb6a5cd8d
      https://github.com/llvm/llvm-project/commit/09141f1adf2dd400e0104e87270f7b7fb6a5cd8d
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M mlir/docs/Dialects/LLVM.md
    M mlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    A mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    A mlir/lib/Dialect/LLVMIR/IR/LLVMIntrinsicOps.cpp
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir] Split intrinsics out of LLVMOps.td

Move the operations that correspond to LLVM IR intrinsics in a separate .td
file. This makes it easier to maintain the intrinsics and decreases the compile
time of LLVMDialect.cpp by ~25%.

Depends On D123310

Reviewed By: wsmoses, jacquesguan

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


Compare: https://github.com/llvm/llvm-project/compare/0c44115e5120...09141f1adf2d


More information about the All-commits mailing list