summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/Traits.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-3/+3
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* [mlir] Fix -Wrange-loo-analysis warningsFangrui Song2020-01-011-1/+1
| | | | | | | | | | | | for (const auto &x : llvm::zip(..., ...)) -> for (auto x : llvm::zip(..., ...)) The return type of zip() is a wrapper that wraps a tuple of references. > warning: loop variable 'p' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<long> &, ArrayRef<long> &>' does not return a reference [-Wrange-loop-analysis]
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-181-3/+2
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Switch C++14 std::equal usage to for-loop.Jacques Pienaar2019-07-191-2/+6
| | | | | | Version of std::equal used required C++14, switching to for-loop for now. Just a direct change from std::equal to the equivalent using for loop. PiperOrigin-RevId: 258970366
* Relax Broadcastable trait to only reject instances that are statically ↵Smit Hinsu2019-07-191-10/+36
| | | | | | | | | | | | incompatible Currently, Broadcastable trait also rejects instances when the op result has shape other than what can be statically inferred based on the operand shapes even if the result shape is compatible with the inferred broadcasted shape. For example, (tensor<3x2xi32>, tensor<*xi32>) -> tensor<4x3x2xi32> (tensor<2xi32>, tensor<2xi32>) -> tensor<*xi32> PiperOrigin-RevId: 258647493
* Rename VectorOrTensorType to ShapedTypeGeoffrey Martin-Noble2019-05-201-4/+4
| | | | | | | | | | | | This is in preparation for making it also support/be a parent class of MemRefType. MemRefs have similar shape/rank/element semantics and it would be useful to be able to use these same utilities for them. This CL should not change any semantics and only change variables, types, string literals, and comments. In follow-up CLs I will prepare all callers to handle MemRef types or remove their dependence on ShapedType. Discussion/Rationale in https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/cHLoyfGu8y8 -- PiperOrigin-RevId: 248476449
* Only forbid mixing tensor and vector when considering broadcasting behaviorLei Zhang2019-05-101-53/+32
| | | | | | | | | The previous approach is too restrictive; we end up forbidding all dialect-specific types as element types. Changed to not consider element types entirely. -- PiperOrigin-RevId: 247486537
* Simplify the emission of various diagnostics emitted by the different ↵River Riddle2019-05-101-4/+4
| | | | | | | | dialects (Affine/Standard/etc.) by using the new stream interface instead of Twine. -- PiperOrigin-RevId: 246842016
* Rewrite the verify hooks on operations to use LogicalResult instead of ↵River Riddle2019-04-021-2/+2
| | | | | | | | bool. This also changes the return of Operation::emitError/emitOpError to LogicalResult as well. -- PiperOrigin-RevId: 241588075
* Replace remaining usages of the Instruction class with Operation.River Riddle2019-03-291-1/+1
| | | | PiperOrigin-RevId: 240777521
* Remove const from Value, Instruction, Argument, and the various methods on theChris Lattner2019-03-291-1/+1
| | | | | | *Op classes. This is a net reduction by almost 400LOC. PiperOrigin-RevId: 239972443
* Change getBroadcastedShape() to return result shape via parameterLei Zhang2019-03-291-10/+11
| | | | | | This is a more efficient way than returning SmallVector directly. PiperOrigin-RevId: 239407024
* Allow input and output to have different element types for broadcastable opsLei Zhang2019-03-291-3/+19
| | | | | | | | TensorFlow comparison ops like tf.Less supports broadcast behavior but the result type have different element types as the input types. Extend broadcastable trait to allow such cases. Added tf.Less to demonstrate it. PiperOrigin-RevId: 237846127
* Pull shape broadcast out as a stand-alone utility functionLei Zhang2019-03-291-35/+60
| | | | | | | | So that we can use this function to deduce broadcasted shapes elsewhere. Also added support for unknown dimensions, by following TensorFlow behavior. PiperOrigin-RevId: 237846065
* Add binary broadcastable builder.Jacques Pienaar2019-03-291-1/+4
| | | | | | | | | * Add common broadcastable binary adder in TF ops and use for a few ops; - Adding Sub, Mul here * Change the prepare lowering to use TF variants; * Add some more legalization patterns; PiperOrigin-RevId: 233310952
* Handle dynamic shapes in Broadcastable op traitSmit Hinsu2019-03-291-3/+13
| | | | | | | | | | | | | | That allows TensorFlow Add and Div ops to use Broadcastable op trait instead of more restrictive SameValueType op trait. That in turn allows TensorFlow ops to be registered by defining GET_OP_LIST and including the generated ops file. Currently, tf-raise-control-flow pass tests are using dynamic shapes in tf.Add op and AddOp can't be registered without supporting the dynamic shapes. TESTED with unit tests PiperOrigin-RevId: 232927998
* Remove remaining references to OperationInst in all directories except for ↵River Riddle2019-03-291-1/+1
| | | | | | lib/Transforms. PiperOrigin-RevId: 232322771
* Migrate VectorOrTensorType/MemRefType shape api to use int64_t instead of int.River Riddle2019-03-291-2/+2
| | | | PiperOrigin-RevId: 230605756
* Promote broadcast logic from TensorFlowLite to Dialect/ directoryLei Zhang2019-03-291-0/+157
We also need the broadcast logic in the TensorFlow dialect. Move it to a Dialect/ directory for a broader scope. This Dialect/ directory is intended for code not in core IR, but can potentially be shared by multiple dialects. Apart from fixing TensorFlow op TableGen to use this trait, this CL only contains mechanical code shuffling. PiperOrigin-RevId: 229563911
OpenPOWER on IntegriCloud