summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
AgeCommit message (Collapse)Author
2025-09-18[MLIR] Apply clang-tidy fixes for readability-simplify-boolean-expr in ↵Mehdi Amini
InlinerInterfaceImpl.cpp (NFC)
2025-08-21[mlir] add getViewDest method to viewLikeOpInterface (#154524)donald chen
The viewLikeOpInterface abstracts the behavior of an operation view one buffer as another. However, the current interface only includes a "getViewSource" method and lacks a "getViewDest" method. Previously, it was generally assumed that viewLikeOpInterface operations would have only one return value, which was the view dest. This assumption was broken by memref.extract_strided_metadata, and more operations may break these silent conventions in the future. Calling "viewLikeInterface->getResult(0)" may lead to a core dump at runtime. Therefore, we need 'getViewDest' method to standardize our behavior. This patch adds the getViewDest function to viewLikeOpInterface and modifies the usage points of viewLikeOpInterface to standardize its use.
2025-08-08[IR] Remove size argument from lifetime intrinsics (#150248)Nikita Popov
Now that #149310 has restricted lifetime intrinsics to only work on allocas, we can also drop the explicit size argument. Instead, the size is implied by the alloca. This removes the ability to only mark a prefix of an alloca alive/dead. We never used that capability, so we should remove the need to handle that possibility everywhere (though many key places, including stack coloring, did not actually respect this).
2025-07-30[MLIR] Migrate InlinerInterfaceImpl to the new LDBG() debug form (NFC) (#150853)Mehdi Amini
2025-07-19[mlir][NFC] update LLVM create APIs (2/n) (#149667)Maksim Levental
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-04-07[MLIR][LLVM] Block address support (#134335)Bruno Cardoso Lopes
Add support for import and translate. MLIR does not support using basic block references outside a function (like LLVM does), This PR does not consider changes to MLIR to that respect. It instead introduces two new ops: `llvm.blockaddress` and `llvm.blocktag`. Here's an example: ``` llvm.func @ba() -> !llvm.ptr { %0 = llvm.blockaddress <function = @ba, tag = <id = 1>> : !llvm.ptr llvm.br ^bb1 ^bb1: // pred: ^bb0 llvm.blocktag <id = 1> llvm.return %0 : !llvm.ptr } ``` Value `%0` hold the address of block tagged as `id = 1` in function `@ba`. Block tags need to be unique within a function and use of `llvm.blockaddress` requires a matching tag in a `llvm.blocktag`.
2025-04-07[mlir][llvm] Respect call noinline attr in inliner (#134493)Tobias Gysi
This commit extends the LLVM dialect inliner interface to respect the call op's noinline attribute. This is a follow-up to https://github.com/llvm/llvm-project/pull/133726 which added the noinline attribute to the LLVM dialect call op.
2025-01-20[MLIR][LLVM] Improve inlining debug information (#123520)Tobias Gysi
This commit improves the debug information for `alloca` and `memcpy` operations generated by the LLVM dialect inlining interface. When inlining by value parameters, the inliner creates `alloca` and `memcpy` operations. This revision sets the location of these created operations to the respective argument locations instead of the function location. This change enables users to better identify the source code location of the copied variables.
2025-01-13[MLIR][LLVM] Fix inlining of a single block ending with unreachable (#122646)William Moses
alternate option to https://github.com/llvm/llvm-project/pull/122615
2025-01-13[MLIR][NVVM] Enable inlining of func's calling nvvm intrinsics (#122650)William Moses
2025-01-11[MLIR] Enable inlining for private symbols (#122572)William Moses
The inlining code for llvm funcs seems to have needlessly forbidden inlining of private (e.g. non-cloning) symbols.
2024-11-08[mlir][IR][NFC] Cleanup insertion point API usage (#115415)Matthias Springer
Use `setInsertionPointToStart` / `setInsertionPointToEnd` when possible.
2024-10-09[MLIR][LLVM] Use ViewLikeOpInterface (#111663)Tobias Gysi
This commit adds the ViewLikeOpInterface to the GEP and AddrSpaceCast operations. This allows us to simplify the inliner interface. At the same time, the change also makes the inliner interface more extensible for downstream users that have custom view-like operations.
2024-08-20[MLIR] Introduce a SelectLikeOpInterface (#104751)Christian Ulmann
This commit introduces a `SelectLikeOpInterface` that can be used to handle select-like operations generically. Select operations are similar to control flow operations, as they forward operands depending on conditions. This is the reason why it was placed to the already existing control flow interfaces.
2024-08-19[MLIR][LLVM] Improve the noalias propagation during inlining (#104750)Christian Ulmann
This commit changes the LLVM dialect's inliner interface to properly propagate noalias information to memory accesses that have different underlying object. By always introducing an SSACopy intrinsic, it's possible to understand that specific memory operations are using unrelated pointers. Previously, the backwards slice walk did continue beyond the boundary of the original function and failed to reason about the "underlying objects".
2024-08-15[MLIR][LLVM]: Add an IR utility to perform slice walking (#103053)Christian Ulmann
This commit introduces a slicing utility that can be used to walk arbitrary IR slices. It additionally ships logic to determine control flow predecessors, which allows users to walk backward slices without dealing with both `RegionBranchOpInterface` and `BranchOpInterface`. This utility is used to improve the `noalias` propagation in the LLVM dialect's inliner interface. Before this change, it broke down as soon as pointer were passed through region control flow operations.
2024-08-14[MLIR][LLVM] Turn the inliner interface into a promised interface (#103927)Christian Ulmann
This commit changes the LLVM dialect's inliner interface to no longer be registered at dialect initialization. Instead, it is now a promised interface, that needs to be registered explicitly. This change is desired to avoid pulling in a lot of dependencies into the `MLIRLLVMDialect` library, especially considering future patches that plan to extend it further with strong IR analysis.