[mlir] Create a std op instead of chain of ops.
authorHanhan Wang <hanchung@google.com>
Tue, 10 Mar 2020 21:59:47 +0000 (14:59 -0700)
committerHanhan Wang <hanchung@google.com>
Tue, 10 Mar 2020 22:01:44 +0000 (15:01 -0700)
commitc0f4408d76f06cc106a257e8a160ec66c5b15025
tree161f3d1720d2eeaca774c7c58d61d6051f2e8fdf
parentfde9d33f7101bac631b26990d17822474d3a34e9
[mlir] Create a std op instead of chain of ops.

Summary:
1-bit integer is tricky in different dialects sometimes. E.g., there is no
arithmetic instructions on 1-bit integer in SPIR-V, i.e., `spv.IMul %0, %1 : i1`
is not valid. Instead, `spv.LogicalAnd %0, %1 : i1` is valid. Creating the op
directly makes lowering easier because we don't need to match a complicated
pattern like `!(!lhs && !rhs)`. Also, this matches the semantic better.

Also add assertions on inputs.

Differential Revision: https://reviews.llvm.org/D75764
mlir/lib/Dialect/AffineOps/EDSC/Builders.cpp
mlir/test/EDSC/builder-api-test.cpp