summaryrefslogtreecommitdiff
path: root/mlir/test/lib/Dialect/SCF/TestParallelLoopUnrolling.cpp
AgeCommit message (Collapse)Author
2025-10-27[mlir][scf] Add parallelLoopUnrollByFactors() (#164958)fabrizio-indirli
- In the SCF Utils, add the `parallelLoopUnrollByFactors()` function to unroll scf::ParallelOp loops according to the specified unroll factors - Add a test pass "TestParallelLoopUnrolling" and the related LIT test - Expose `mlir::parallelLoopUnrollByFactors()`, `mlir::generateUnrolledLoop()`, and `mlir::scf::computeUbMinusLb()` functions in the mlir/Dialect/SCF/Utils/Utils.h and /IR/SCF.h headers to make them available to other passes. - In `mlir::generateUnrolledLoop()`, add an optional `IRMapping *clonedToSrcOpsMap` argument to map the new cloned operations to their original ones. In the function body, change the default `AnnotateFn` type to `static const` to silence potential warnings about dangling references when a function_ref is assigned to a variable with automatic storage. Signed-off-by: Fabrizio Indirli <Fabrizio.Indirli@arm.com>
2025-10-24Revert "[mlir][scf] Add parallelLoopUnrollByFactors()" (#164949)fabrizio-indirli
Reverts llvm/llvm-project#163806 due to linking errors on the function `mlir::scf::computeUbMinusLb`
2025-10-24[mlir][scf] Add parallelLoopUnrollByFactors() (#163806)fabrizio-indirli
- In the SCF Utils, add the `parallelLoopUnrollByFactors()` function to unroll scf::ParallelOp loops according to the specified unroll factors - Add a test pass "TestParallelLoopUnrolling" and the related LIT test - Expose `mlir::parallelLoopUnrollByFactors()`, `mlir::generateUnrolledLoop()`, and `mlir::scf::computeUbMinusLb()` functions in the mlir/Dialect/SCF/Utils/Utils.h header to make them available to other passes. - In `mlir::generateUnrolledLoop()`, add also an optional `IRMapping *clonedToSrcOpsMap` argument to map the new cloned operations to their original ones. In the function body, change the default `AnnotateFn` type to `static const` to silence potential warnings about dangling references when a function_ref is assigned to a variable with automatic storage. Signed-off-by: Fabrizio Indirli <Fabrizio.Indirli@arm.com>