iree-org / iree-llvm-sandbox

A sandbox for quick iteration and experimentation on projects related to IREE, MLIR, and LLVM
Apache License 2.0
54 stars 31 forks source link

[Substrait] Add folder for EmitOp with identity mapping. #827

Closed ingomueller-net closed 5 months ago

ingomueller-net commented 5 months ago

This PR is based on and, therefor, includes #825 and its dependencies.

This folds the result of an emit op with identity mapping to its input. For example, it folds the following snippet:

%0 = named_table @t1 as ["a", "b"] : tuple<si1, si32>
%1 = emit [0, 1] from %0 : tuple<si1, si32> -> tuple<si1, si32>
// usages of %1

into

%0 = named_table @t1 as ["a", "b"] : tuple<si1, si32>
// usages of %0 instead of %1