[mlir] Add for loop specialization
authorStephan Herhut <herhut@google.com>
Fri, 19 Jun 2020 12:14:30 +0000 (14:14 +0200)
committerStephan Herhut <herhut@google.com>
Mon, 22 Jun 2020 08:14:17 +0000 (10:14 +0200)
commit4bcd08eb1c3bcd6ce580cc21b4e6d9f10286b9e6
tree3f5332bea167e9ed2ccba04683b53f2fc62ddba8
parent46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6
[mlir] Add for loop specialization

Summary:
We already had a parallel loop specialization pass that is used to
enable unrolling and consecutive vectorization by rewriting loops
whose bound is defined as a min of a constant and a dynamic value
into a loop with static bound (the constant) and the minimum as
bound, wrapped into a conditional to dispatch between the two.
This adds the same rewriting for for loops.

Differential Revision: https://reviews.llvm.org/D82189
mlir/include/mlir/Dialect/SCF/Passes.h
mlir/include/mlir/Dialect/SCF/Passes.td
mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp [moved from mlir/lib/Dialect/SCF/Transforms/ParallelLoopSpecialization.cpp with 50% similarity]
mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp
mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp
mlir/test/Dialect/SCF/for-loop-specialization.mlir [new file with mode: 0644]