commit | f88f8fd0bca34dc8e5571cb828b1a159a50fd504 | [log] [tgz] |
---|---|---|
author | Théo Degioanni <theo.degioanni@nextsilicon.com> | Thu Apr 27 06:00:39 2023 +0000 |
committer | Tobias Gysi <tobias.gysi@nextsilicon.com> | Thu Apr 27 06:00:48 2023 +0000 |
tree | ffa24b2b6200845f4e641da7cac0689a28d3d2d4 | |
parent | c00b7c84c7cb1d528464bf68305fd23a9755768c [diff] |
[mlir] Add a generic mem2reg implementation. This patch introduces a generic implementation of mem2reg on unstructured control-flow, along with a specialization for LLVM IR. This is achieved by defining three new interfaces, representing 1. allocating operations, 2. operations doing memory accesses, 3. operations that can be rewired and/or deleted to stop using a specific use. The file containing the core implementation of the algorithm (`Mem2Reg.cpp`) contains a detailed explanation of how the algorithm works. The contract for this pass is that given a memory slot with a single non-aliased pointer, the pass will either remove all the uses of the pointer or not change anything. To help review this patch, I recommend starting by looking at the interfaces defined in `Mem2Reg.td`, along with their reference implementation for LLVM IR defined in `LLVMMem2Reg.cpp`. Then, the core algorithm is implemented in `Mem2Reg.cpp`. If this is all good I also have an implementation of the interfaces for 0-dimensional memref promotion that I can upstream afterwards. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D148109
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, or #llvm IRC channel on OFTC.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.