Add a pass that specializes parallel loops for easier unrolling and vectorization
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 27 Feb 2020 12:24:27 +0000 (13:24 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 28 Feb 2020 18:47:23 +0000 (19:47 +0100)
commit5abf128d647df65d65e75fd26edb5268f30f6fe0
treeeef10b4f8c19561f49285b543200fc2d74e82982
parent586f13aeac3fd51916774f523e30f0aee2b62d46
Add a pass that specializes parallel loops for easier unrolling and vectorization

This matches loops with a affine.min upper bound, limiting the trip
count to a constant, and rewrites them into two loops, one with constant
upper bound and one with variable upper bound. The assumption is that
the constant upper bound loop will be unrolled and vectorized, which is
preferable if this is the hot path.

Differential Revision: https://reviews.llvm.org/D75240
mlir/include/mlir/Dialect/LoopOps/Passes.h
mlir/include/mlir/InitAllPasses.h
mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopSpecialization.cpp [new file with mode: 0644]
mlir/test/Dialect/Loops/parallel-loop-specialization.mlir [new file with mode: 0644]