[mlir] [VectorOps] Improve vector.constant_mask lowering
authoraartbik <ajcbik@google.com>
Fri, 19 Jun 2020 17:40:03 +0000 (10:40 -0700)
committeraartbik <ajcbik@google.com>
Fri, 19 Jun 2020 17:40:08 +0000 (10:40 -0700)
commit0d82ab788534bfc05a4455292e27ed035caac639
tree9ea3f7939964bfa305f8b9ae2fdd08f735eb2bbd
parentf3e8f9617365f129a0e9876fc3d38f15d6f2d4fd
[mlir] [VectorOps] Improve vector.constant_mask lowering

Use direct vector constants for the 1-D case. This approach
scales much better than generating elaborate insertion operations
that are eventually folded into a constant. We could of course
generalize the 1-D case to higher ranks, but this simplification
already helps in scaling some microbenchmarks that would formerly
crash on the intermediate IR length.

Reviewed By: reidtatge

Differential Revision: https://reviews.llvm.org/D82144
mlir/include/mlir/IR/Builders.h
mlir/lib/Dialect/Vector/VectorTransforms.cpp
mlir/lib/IR/Builders.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Dialect/Vector/vector-contract-transforms.mlir