Ivan Butygin b153c05cba
[mlir][scf] Uplift scf.while to scf.for (#76108)
Add uplifting from `scf.while` to `scf.for`.

This uplifting expects a very specific ops pattern:
* `before` block consisting of single `arith.cmp` op
* `after` block containing `arith.addi`

We also have a set of patterns to cleanup `scf.while` loops to get them
close to the desired form, they will be added in separate PRs.

This is part of upstreaming `numba-mlir` scf uplifting pipeline: `cf ->
scf.while -> scf.for -> scf.parallel`

Original code:
https://github.com/numba/numba-mlir/blob/main/mlir/lib/Transforms/PromoteToParallel.cpp
2024-04-15 22:16:59 +03:00

46 lines
967 B
CMake

add_mlir_dialect_library(MLIRSCFTransforms
BufferDeallocationOpInterfaceImpl.cpp
BufferizableOpInterfaceImpl.cpp
Bufferize.cpp
ForToWhile.cpp
LoopCanonicalization.cpp
LoopPipelining.cpp
LoopRangeFolding.cpp
LoopSpecialization.cpp
OneToNTypeConversion.cpp
ParallelLoopCollapsing.cpp
ParallelLoopFusion.cpp
ParallelLoopTiling.cpp
StructuralTypeConversions.cpp
TileUsingInterface.cpp
WrapInZeroTripCheck.cpp
UpliftWhileToFor.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SCF
DEPENDS
MLIRSCFPassIncGen
LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineAnalysis
MLIRArithDialect
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRDestinationStyleOpInterface
MLIRDialectUtils
MLIRIR
MLIRMemRefDialect
MLIRPass
MLIRSCFDialect
MLIRSCFUtils
MLIRSideEffectInterfaces
MLIRSupport
MLIRTensorDialect
MLIRTensorTransforms
MLIRTilingInterface
MLIRTransforms
MLIRTransformUtils
)