summaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp
AgeCommit message (Collapse)Author
2025-08-23[MLIR] Adopt LDBG() macro in ControlFlowSinkUtils.cpp (NFC)Mehdi Amini
2023-03-15[ADT][mlir][NFCI] Do not use non-const lvalue-refs with enumerateJakub Kuderski
Replace references to enumerate results with either result_pairs (reference wrapper type) or structured bindings. I did not use structured bindings everywhere as it wasn't clear to me it would improve readability. This is in preparation to the switch to zip semantics which won't support non-const lvalue reference to elements: https://reviews.llvm.org/D144503. I chose to use values instead of const lvalue-refs because MLIR is biased towards avoiding `const` local variables. This won't degrade performance because currently `result_pair` is cheap to copy (size_t + iterator), and in the future, the enumerator iterator dereference will return temporaries anyway. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D146006
2022-04-16[mlir] Refactor LICM into a utilityMogball
LICM is refactored into a utility that is application on any region. The implementation is moved to Transform/Utils.
2022-04-15Revert "[mlir] Refactor LICM into a utility"Stella Stamenova
This reverts commit 3131f808243abe3746280e016ab9459c14d9e53b. This commit broke the Windows mlir bot: https://lab.llvm.org/buildbot/#/builders/13/builds/19745
2022-04-15[mlir] Refactor LICM into a utilityMogball
LICM is refactored into a utility that is application on any region. The implementation is moved to Transform/Utils.
2022-04-15Apply clang-tidy fixes for modernize-use-default-member-init in ↵Mehdi Amini
ControlFlowSinkUtils.cpp (NFC)
2022-03-28[mlir][cf-sink] Accept a callback for sinking operationsMogball
(This was a TODO from the initial patch). The control-flow sink utility accepts a callback that is used to sink an operation into a region. The `moveIntoRegion` is called on the same operation and region that return true for `shouldMoveIntoRegion`. The callback must preserve the dominance of the operation within the region. In the default control-flow sink implementation, this is moving the operation to the start of the entry block. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D122445
2022-03-07Apply clang-tidy fixes for modernize-use-default-member-init to MLIR (NFC)Mehdi Amini
2022-01-24[mlir:Transforms] Move out the remaining non-dialect independent transforms ↵River Riddle
and utilities This has been a major TODO for a very long time, and is necessary for establishing a proper dialect-free dependency layering for the Transforms library. Code was moved to effectively two main locations: * Affine/ There was quite a bit of affine dialect related code in Transforms/ do to historical reasons (of a time way into MLIR's past). The following headers were moved to: Transforms/LoopFusionUtils.h -> Dialect/Affine/LoopFusionUtils.h Transforms/LoopUtils.h -> Dialect/Affine/LoopUtils.h Transforms/Utils.h -> Dialect/Affine/Utils.h The following transforms were also moved: AffineLoopFusion, AffinePipelineDataTransfer, LoopCoalescing * SCF/ Only one SCF pass was in Transforms/ (likely accidentally placed here): ParallelLoopCollapsing The SCF specific utilities in LoopUtils have been moved to SCF/Utils.h * Misc: mlir::moveLoopInvariantCode was also moved to LoopLikeInterface.h given that it is a simple utility defined in terms of LoopLikeOpInterface. Differential Revision: https://reviews.llvm.org/D117848
2022-01-24[mlir] NFC control-flow sink cleanupMogball
2022-01-24[mlir] Add a ControlFlowSink pass.Mogball
Control-Flow Sink moves operations whose only uses are in conditionally-executed regions into those regions so that paths in which their results are not needed do not perform unnecessary computation. Depends on D115087 Reviewed By: jpienaar, rriddle, bondhugula Differential Revision: https://reviews.llvm.org/D115088