[all-commits] [llvm/llvm-project] 2fe30a: [mlir] properly support min/max in affine parallel...
ftynse via All-commits
all-commits at lists.llvm.org
Tue Dec 8 01:48:33 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 2fe30a3534dad9f982a3d840b4bfa4870b2ba5bc
https://github.com/llvm/llvm-project/commit/2fe30a3534dad9f982a3d840b4bfa4870b2ba5bc
Author: Alex Zinenko <zinenko at google.com>
Date: 2020-12-08 (Tue, 08 Dec 2020)
Changed paths:
M mlir/lib/Dialect/Affine/Utils/Utils.cpp
M mlir/test/Dialect/Affine/parallelize.mlir
Log Message:
-----------
[mlir] properly support min/max in affine parallelization
The existing implementation of the affine parallelization silently copies over
the lower and upper bound maps from affine.for to affine.parallel. However, the
semantics of these maps differ between these two ops: in affine.for, a max(min)
of results is taken for the lower(upper) bound; in affine.parallel, multiple
induction variables can be defined an each result corresponds to one induction
variable. Thus the existing implementation could generate invalid IR or IR that
passes the verifier but has different semantics than the original code. Fix the
parallelization utility to emit dedicated min/max operations before the
affine.parallel in such cases. Disallow parallelization if min/max would have
been in an operation without the AffineScope trait, e.g., in another loop,
since the result of these operations is not considered a valid affine dimension
identifier and may not be properly handled by the affine analyses.
Reviewed By: wsmoses
Differential Revision: https://reviews.llvm.org/D92763
More information about the All-commits
mailing list