[MLIR] Clarify (test-scf-)parallel-loop-collapsing
authorTres Popp <tpopp@google.com>
Tue, 4 Apr 2023 09:36:30 +0000 (11:36 +0200)
committerTres Popp <tpopp@google.com>
Wed, 5 Apr 2023 11:41:15 +0000 (13:41 +0200)
commit981932bc57aeaa6d4dd02b011d848ed9fa4dd615
treecf26a9039245570b8f5838d254eea00b22889e57
parentaf9e1fa178433653eb3d36c42cad016449873cfc
[MLIR] Clarify (test-scf-)parallel-loop-collapsing

1. parallel-loop-collapsing is renamed to test-scf-parallel-loop-collapsing.
2. The pass adds various checks to provide error messages instead of
   hitting assert failures.
3. Testing is added to verify these error messages

This is roughly an NFC. The name changes, but all checked behavior
previously would have resulted in an assertion failure. Almost no new
support is added, so this pass is still limited in scope to testing the
transform behaves correctly with input arguments that perfectly match
the ParallelLoop's iterator arg set. The one new piece of functionality
is that invalid operations will now be skipped with an error messages
instead of producing an assertion failure, so the pass can be used with
expected failures for pieces of the IR not cared about with a specific
RUN command.

Differential Revision: https://reviews.llvm.org/D147514
mlir/include/mlir/Dialect/SCF/Transforms/Passes.h
mlir/include/mlir/Dialect/SCF/Transforms/Passes.td
mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
mlir/test/Transforms/invalid-parallel-loop-collapsing.mlir [new file with mode: 0644]
mlir/test/Transforms/parallel-loop-collapsing.mlir
mlir/test/Transforms/single-parallel-loop-collapsing.mlir