[all-commits] [llvm/llvm-project] 569f07: [mlir][LLVM] Add support for arrays in `SplitStore...

Markus Böck via All-commits all-commits at lists.llvm.org
Mon Jul 10 06:57:04 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 569f07319105500f0b19e6962370439b54a67e80
  Author: Markus Böck <markus.bock+llvm at nextsilicon.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M mlir/lib/Dialect/LLVMIR/Transforms/TypeConsistency.cpp
    M mlir/test/Dialect/LLVMIR/type-consistency.mlir

  Log Message:
  [mlir][LLVM] Add support for arrays in `SplitStores` pattern

The pattern so far has only supported splitting stores into struct types, marking arrays as explicitly unsupported. This would lead to stores into arrays not being made type-consistent like structs and therefore also not being properly split by SROA and mem2reg.

This patch adds support for array types by creating a common abstraction for both structs and arrays, making an array of size n essentially be treated like a struct with n fields of the arrays element type.
This gives us immediate feature parity without special casing for either of the types.

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

More information about the All-commits mailing list