llvm-capstone/mlir
Théo Degioanni 8404b23acd [mlir][llvm] Add memset support for mem2reg/sroa
This revision introduces support for memset intrinsics in SROA and
mem2reg for the LLVM dialect. This is achieved for SROA by breaking
memsets of aggregates into multiple memsets of scalars, and for mem2reg
by promoting memsets of single integer slots into the value the memset
operation would yield.

The SROA logic supports breaking memsets of static size operating at the
start of a memory slot. The intended most common case is for memsets
covering the entirety of a struct, most often as a way to initialize it
to 0.

The mem2reg logic supports dynamic values and static sizes as input to
promotable memsets. This is achieved by lowering memsets into
`ceil(log_2(n))` LeftShift operations, `ceil(log_2(n))` Or operations
and up to one ZExt operation (for n the byte width of the integer),
computing in registers the integer value the memset would create. Only
byte-aligned integers are supported, more types could easily be added
afterwards.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D152367
2023-06-14 09:17:08 +00:00
..
benchmark/python [NFC][Py Reformat] Reformat python files in mlir subdir 2023-05-26 08:05:40 +02:00
cmake/modules [mlir] Add support for "promised" interfaces 2023-06-09 11:30:13 -07:00
docs [MLIR][Doc] Also print summarys for passes on a newline 2023-06-13 09:26:11 +02:00
examples [mlir] Add support for "promised" interfaces 2023-06-09 11:30:13 -07:00
include [mlir][llvm] Add memset support for mem2reg/sroa 2023-06-14 09:17:08 +00:00
lib [mlir][llvm] Add memset support for mem2reg/sroa 2023-06-14 09:17:08 +00:00
python [MLIR][python bindings] Add TypeCaster for returning refined types from python APIs 2023-05-26 11:02:05 -05:00
test [mlir][llvm] Add memset support for mem2reg/sroa 2023-06-14 09:17:08 +00:00
tools [MLIR][Doc] Also print summarys for passes on a newline 2023-06-13 09:26:11 +02:00
unittests [mlir] Add support for "promised" interfaces 2023-06-09 11:30:13 -07:00
utils tree-sitter-mlir: add a more complete grammar 2023-06-05 19:11:06 +01:00
.clang-format
.clang-tidy
CMakeLists.txt Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
LICENSE.TXT
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.