[all-commits] [llvm/llvm-project] 1916b0: [mlir] support data layout specs on ModuleOp

ftynse via All-commits all-commits at lists.llvm.org
Wed Mar 24 07:14:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1916b0e098ad6ddeb746c4720099fb96bff02d31
      https://github.com/llvm/llvm-project/commit/1916b0e098ad6ddeb746c4720099fb96bff02d31
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M mlir/docs/DataLayout.md
    M mlir/include/mlir/IR/BuiltinOps.h
    M mlir/include/mlir/IR/BuiltinOps.td
    M mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
    M mlir/lib/Dialect/DLTI/DLTI.cpp
    M mlir/lib/IR/BuiltinDialect.cpp
    M mlir/lib/IR/CMakeLists.txt
    M mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    M mlir/test/Dialect/DLTI/invalid.mlir
    M mlir/test/IR/module-op.mlir
    A mlir/test/Interfaces/DataLayoutInterfaces/module.mlir
    M mlir/test/lib/Transforms/TestDataLayoutQuery.cpp

  Log Message:
  -----------
  [mlir] support data layout specs on ModuleOp

ModuleOp is a natural place to provide scoped data layout information. However,
it is undesirable for ModuleOp to implement the entirety of
DataLayoutOpInterface because that would require either pushing the interface
inside the IR library instead of a separate library, or putting the default
implementation of the interface as inline functions in headers leading to
binary bloat. Instead, ModuleOp accepts an arbitrary data layout spec attribute
and has a dedicated hook to extract it, and DataLayout is modified to know
about ModuleOp particularities.

Reviewed By: herhut, nicolasvasilache

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


  Commit: f9cdc61d1131140a3e9b30a5e9eb72e0b14261b5
      https://github.com/llvm/llvm-project/commit/f9cdc61d1131140a3e9b30a5e9eb72e0b14261b5
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M mlir/docs/DataLayout.md
    M mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
    M mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
    M mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    M mlir/test/Interfaces/DataLayoutInterfaces/module.mlir
    M mlir/test/Interfaces/DataLayoutInterfaces/query.mlir
    M mlir/test/lib/Dialect/Test/TestTypes.h
    M mlir/test/lib/Transforms/TestDataLayoutQuery.cpp
    M mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp

  Log Message:
  -----------
  [mlir] provide a version of data layout size hooks in bits

This is useful for bit-packing types such as vectors and tuples as well as for
exotic architectures that have non-8-bit bytes.

Depends On D98500

Reviewed By: rriddle

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


  Commit: 842d2435087279ece543b66351027eac3e55fdf5
      https://github.com/llvm/llvm-project/commit/842d2435087279ece543b66351027eac3e55fdf5
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    M mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp

  Log Message:
  -----------
  [mlir] forward data layout query to scoping op in absence of specification

Even if the layout specification is missing from an op that supports it, the op
is still expected to provide meaningful responses to data layout queries.
Forward them to the op instead of directly calling the default implementation.

Depends On D98524

Reviewed By: rriddle

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


  Commit: b3386a734e430be967e85ab2fb980eeea927ade8
      https://github.com/llvm/llvm-project/commit/b3386a734e430be967e85ab2fb980eeea927ade8
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M mlir/docs/DataLayout.md
    M mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
    M mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
    M mlir/include/mlir/Dialect/GPU/GPUDialect.h
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
    M mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
    M mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
    M mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Dialect/GPU/CMakeLists.txt
    M mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    A mlir/test/Interfaces/DataLayoutInterfaces/types.mlir
    M mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp

  Log Message:
  -----------
  [mlir] introduce data layout entry for index type

Index type is an integer type of target-specific bitwidth present in many MLIR
operations (loops, memory accesses). Converting values of this type to
fixed-size integers has always been problematic. Introduce a data layout entry
to specify the bitwidth of `index` in a given layout scope, defaulting to 64
bits, which is a commonly used assumption, e.g., in constants.

Port builtin-to-LLVM type conversion to use this data layout entry when
converting `index` type and untie it from pointer size. This is particularly
relevant for GPU targets. Keep a possibility to forcibly override the index
type in lowerings.

Depends On D98525

Reviewed By: herhut

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


Compare: https://github.com/llvm/llvm-project/compare/7920527796ea...b3386a734e43


More information about the All-commits mailing list