llvm-project/mlir/test/Transforms
River Riddle 015192c634 [mlir:DialectConversion] Restructure how argument/target materializations get invoked
The current implementation invokes materializations
whenever an input operand does not have a mapping for the
desired type, i.e. it requires materialization at the earliest possible
point. This conflicts with goal of dialect conversion (and also the
current documentation) which states that a materialization is only
required if the materialization is supposed to persist after the
conversion process has finished.

This revision refactors this such that whenever a target
materialization "might" be necessary, we insert an
unrealized_conversion_cast to act as a temporary materialization.
This allows for deferring the invocation of the user
materialization hooks until the end of the conversion process,
where we actually have a better sense if it's actually
necessary. This has several benefits:

* In some cases a target materialization hook is no longer
   necessary
When performing a full conversion, there are some situations
where a temporary materialization is necessary. Moving forward,
these users won't need to provide any target materializations,
as the temporary materializations do not require the user to
provide materialization hooks.

* getRemappedValue can now handle values that haven't been
   converted yet
Before this commit, it wasn't well supported to get the remapped
value of a value that hadn't been converted yet (making it
difficult/impossible to convert multiple operations in many
situations). This commit updates getRemappedValue to properly
handle this case by inserting temporary materializations when
necessary.

Another code-health related benefit is that with this change we
can move a majority of the complexity related to materializations
to the end of the conversion process, instead of handling adhoc
while conversion is happening.

Differential Revision: https://reviews.llvm.org/D111620
2021-10-27 02:09:04 +00:00
..
buffer-deallocation.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
buffer-hoisting.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
buffer-loop-hoisting.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
buffer-results-to-out-params.mlir [MLIR] Use memref.copy ops in BufferResultsToOutParams pass. 2021-09-15 02:59:30 +00:00
canonicalize-block-merge.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
canonicalize-dce.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
canonicalize-td.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
canonicalize.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
compose-subview.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
constant-fold.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
cse.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
decompose-call-graph-types.mlir
finalizing-bufferize.mlir
inlining-dce.mlir
inlining.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
location-snapshot.mlir
loop-coalescing.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-2.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-3.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-4.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-dependence-check.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-slice-computation.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion-transformation.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-fusion.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
loop-invariant-code-motion.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
memref-bound-check.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
memref-dependence-check.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
normalize-memrefs-ops-dynamic.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
normalize-memrefs-ops.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
normalize-memrefs.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
parallel-loop-collapsing.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
parametric-mapping.mlir
parametric-tiling.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
pipeline-data-transfer.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
print-op-graph.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
promote-buffers-to-stack.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
sccp-callgraph.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
sccp-structured.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
sccp.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
scf-if-utils.mlir
scf-loop-unroll.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
scf-loop-utils.mlir
single-parallel-loop-collapsing.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
strip-debuginfo.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
test-canonicalize-filter.mlir
test-canonicalize.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
test-convert-call-op.mlir
test-inlining.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
test-legalize-erased-op-with-uses.mlir
test-legalize-remapped-value.mlir [mlir:DialectConversion] Restructure how argument/target materializations get invoked 2021-10-27 02:09:04 +00:00
test-legalize-type-conversion.mlir [mlir:DialectConversion] Restructure how argument/target materializations get invoked 2021-10-27 02:09:04 +00:00
test-legalize-unknown-root.mlir
test-legalizer-analysis.mlir
test-legalizer-full.mlir [mlir] Fix bug in partial dialect conversion 2021-09-20 10:39:10 +03:00
test-legalizer.mlir [mlir:DialectConversion] Restructure how argument/target materializations get invoked 2021-10-27 02:09:04 +00:00
test-merge-blocks.mlir
test-operation-folder.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
test-pattern-selective-replacement.mlir [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
test-symbol-dce.mlir