HomePhabricator

[mlir] Handle unknown ops in dynamic_tensor_from_elements bufferization

Authored by silvas on Dec 14 2020, 6:22 PM.

Description

[mlir] Handle unknown ops in dynamic_tensor_from_elements bufferization

Due to how the conversion infra works, the "clone" call that this
pattern was using required all the cloned ops to be immediately
legalized as part of this dialect conversion invocation.

That was previously working due to a couple factors:

  • In the test case, there was scf.if, which we happen to mark as legal as part of marking the entire SCF dialect as legal for the scf.parallel we generate here.
  • Originally, this test case had std.extract_element in the body, which we happened to have a pattern for in this pass. After I migrated that to tensor.extract (which removed the tensor.extract bufferization from here), I hacked this up to use std.dim which we still have patterns for in this pass.

This patch updates the test case to use a truly opaque op test.source
that properly stresses this aspect of the pattern.

(this also removes a stray dependency on the tensor dialect that I
must have left behind as part of my hacking this pass up when migrating
to tensor.extract)

Differential Revision: https://reviews.llvm.org/D93262