[all-commits] [llvm/llvm-project] 4ed502: [mlir] Add a generic SROA implementation.

Théo Degioanni via All-commits all-commits at lists.llvm.org
Mon May 22 02:02:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ed502ef4fcc5d9592a3ded662a9cac701fb4392
      https://github.com/llvm/llvm-project/commit/4ed502ef4fcc5d9592a3ded662a9cac701fb4392
  Author: Théo Degioanni <theo.degioanni at nextsilicon.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.td
    M mlir/include/mlir/Interfaces/CMakeLists.txt
    M mlir/include/mlir/Interfaces/MemorySlotInterfaces.h
    M mlir/include/mlir/Interfaces/MemorySlotInterfaces.td
    M mlir/include/mlir/Transforms/Mem2Reg.h
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    A mlir/include/mlir/Transforms/SROA.h
    M mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
    M mlir/lib/Interfaces/MemorySlotInterfaces.cpp
    M mlir/lib/Transforms/CMakeLists.txt
    M mlir/lib/Transforms/Mem2Reg.cpp
    A mlir/lib/Transforms/SROA.cpp
    A mlir/test/Dialect/LLVMIR/sroa-statistics.mlir
    A mlir/test/Dialect/LLVMIR/sroa.mlir

  Log Message:
  -----------
  [mlir] Add a generic SROA implementation.

This revision introduces a generic implementation of Scalar Replacement
Of Aggregates. In contrast to the implementation in LLVM, this focuses
on the core of SROA: destructuring aggregates. By implementing
interfaces on allocators and accessors, memory allocators can be
destructured into smaller allocators, through the MemorySlot
abstraction.

This pass only works on aggregates that are accessed in a "type-safe"
way, that is within the bounds and respecting the type of a given memory
slot. The destructuring pattern and functions only peel off the first
layer of aggregates and can safely be applied repeatedly. For
convenience, the transformation is also available as a pass that will
apply the pattern repeatedly.

Depends on D149958

Reviewed By: gysit

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




More information about the All-commits mailing list