Affine loop parallelism detection: conservatively handle unknown ops
authorAlex Zinenko <zinenko@google.com>
Tue, 23 Jul 2019 17:18:18 +0000 (10:18 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 23 Jul 2019 17:18:46 +0000 (10:18 -0700)
commit480d68f8de924b5232b450a21c878985c6b4fb59
tree1ad456b5e308dbf2ba366bb93a8630094f138202
parent0aed5222d8862436d84883cd0afc93bdff2af919
Affine loop parallelism detection: conservatively handle unknown ops

The loop parallelism detection utility only collects the affine.load and
affine.store operations appearing inside the loop to analyze the access
patterns for the absence of dependences.  However, any operation, including
unregistered operations, can appear in a body of an affine loop.  If such
operation has side effects, the result of parallelism analysis is incorrect.
Conservatively assume affine loops are not parallel in presence of operations
other than affine.load, affine.store, affine.for, affine.terminator that may
have side effects.

This required to update the loop-fusion unit test that relies on parallelism
analysis and was exercising loop fusion in presence of an unregistered
operation.

PiperOrigin-RevId: 259560935
mlir/lib/Analysis/TestParallelismDetection.cpp
mlir/lib/Analysis/Utils.cpp
mlir/test/Transforms/loop-fusion.mlir
mlir/test/Transforms/parallelism-detection.mlir