14 #include "llvm/Support/CommandLine.h" 15 #include "llvm/Support/Debug.h" 17 #define DEBUG_TYPE "parallel-loop-collapsing" 22 struct ParallelLoopCollapsing
23 :
public SCFParallelLoopCollapsingBase<ParallelLoopCollapsing> {
24 void runOnOperation()
override {
27 module->
walk([&](scf::ParallelOp op) {
31 if (!clCollapsedIndices0.empty())
32 combinedLoops.push_back(clCollapsedIndices0);
33 if (!clCollapsedIndices1.empty())
34 combinedLoops.push_back(clCollapsedIndices1);
35 if (!clCollapsedIndices2.empty())
36 combinedLoops.push_back(clCollapsedIndices2);
44 return std::make_unique<ParallelLoopCollapsing>();
Include the generated interface declarations.
Operation is a basic unit of execution within MLIR.
std::unique_ptr< Pass > createParallelLoopCollapsingPass()
Creates a pass that transforms a single ParallelLoop over N induction variables into another Parallel...
void collapseParallelLoops(scf::ParallelOp loops, ArrayRef< std::vector< unsigned >> combinedDimensions)
Take the ParallelLoop and for each set of dimension indices, combine them into a single dimension...
std::enable_if< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT >::type walk(FnT &&callback)
Walk the operation by calling the callback for each nested operation (including this one)...