Add a standard if op
authorNicolas Vasilache <ntv@google.com>
Fri, 5 Jul 2019 10:34:49 +0000 (03:34 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 5 Jul 2019 10:35:18 +0000 (03:35 -0700)
commit991040478b9de4dba2e44787b23f8fe9412e9a82
treeb8f6fa04af5475ed4a9037570658db38e96840a8
parent471da08e4e63b3e1dffde1bca08ba167483f8adf
Add a standard if op

This CL adds an "std.if" op to represent an if-then-else construct whose condition is an arbitrary value of type i1.
This is necessary to lower all the existing examples from affine and linalg to std.for + std.if.

This CL introduces the op and adds the relevant positive and negative unit test. Lowering will be done in a separate followup CL.

PiperOrigin-RevId: 256649138
mlir/include/mlir/StandardOps/Ops.h
mlir/include/mlir/StandardOps/Ops.td
mlir/lib/StandardOps/Ops.cpp
mlir/test/IR/core-ops.mlir
mlir/test/IR/invalid-ops.mlir