Commit Graph

253 Commits

Author SHA1 Message Date
A. Unique TensorFlower 7f84a86cf5 [MLIR][KerneGen] Lower `tf.Atan` all the way to LLVM
PiperOrigin-RevId: 335394668
2020-10-05 05:07:13 -07:00
A. Unique TensorFlower c9f4755863 Integrate LLVM at llvm/llvm-project@22664a3251
Updates LLVM usage to match
[22664a325167](https://github.com/llvm/llvm-project/commit/22664a325167)

PiperOrigin-RevId: 335391717
2020-10-05 04:42:21 -07:00
Alexander Belyaev d927e32451 [HLO] Clean-up dynamic allocation in hlo-legalize-to-lhlo pass.
PiperOrigin-RevId: 335385243
2020-10-05 03:55:24 -07:00
A. Unique TensorFlower 7367eac074 Add folder for mhlo::remainder
PiperOrigin-RevId: 335372628
2020-10-05 02:20:01 -07:00
A. Unique TensorFlower c9e249c124 Integrate LLVM at llvm/llvm-project@88c9162c9d
Updates LLVM usage to match
[88c9162c9d47](https://github.com/llvm/llvm-project/commit/88c9162c9d47)

PiperOrigin-RevId: 335144150
2020-10-02 19:32:46 -07:00
A. Unique TensorFlower 5146c29cbf Integrate LLVM at llvm/llvm-project@0f0cbcc4b1
Updates LLVM usage to match
[0f0cbcc4b166](https://github.com/llvm/llvm-project/commit/0f0cbcc4b166)

PiperOrigin-RevId: 335119390
2020-10-02 16:08:17 -07:00
Tim Shen c708bfd6d0 [MLIR] Add cbrt, reduce-precision, and bitcast ops to MHLO.
PiperOrigin-RevId: 335109804
2020-10-02 15:13:18 -07:00
Tres Popp bcf6fbf612 Integrate LLVM at llvm/llvm-project@8825fec37e
Updates LLVM usage to match
[8825fec37e73](https://github.com/llvm/llvm-project/commit/8825fec37e73)

Adapt to upstream subview / subtensor changes.

PiperOrigin-RevId: 335023452
2020-10-02 07:34:47 -07:00
Tres Popp a3a8c498e1 Integrate LLVM at llvm/llvm-project@bfd7ee92cc
Updates LLVM usage to match
[bfd7ee92ccec](https://github.com/llvm/llvm-project/commit/bfd7ee92ccec)

PiperOrigin-RevId: 335003324
2020-10-02 04:39:31 -07:00
Adrian Kuegel 3eb767b43d Add missing lowering step for IsFiniteOp.
Also add a BUILD target for generating the GPU kernel.

PiperOrigin-RevId: 334993362
2020-10-02 03:09:00 -07:00
Chao Xie 5f303440da [MLIR][KerneGen] Lower `tf.Atan` all the way to LLVM
PiperOrigin-RevId: 334843070
2020-10-01 10:25:51 -07:00
Tres Popp aa65e49ad2 Integrate LLVM at llvm/llvm-project@5101e7e8dd
Updates LLVM usage to match
[5101e7e8dd01](https://github.com/llvm/llvm-project/commit/5101e7e8dd01)

PiperOrigin-RevId: 334812211
2020-10-01 07:49:58 -07:00
A. Unique TensorFlower 458e861254 [MLIR][KerneGen] Lower `tf.Atan` all the way to LLVM
PiperOrigin-RevId: 334810730
2020-10-01 07:38:40 -07:00
Tres Popp 73f461080c Integrate LLVM at llvm/llvm-project@fcf70e1e3b
Updates LLVM usage to match
[fcf70e1e3b1d](https://github.com/llvm/llvm-project/commit/fcf70e1e3b1d)

PiperOrigin-RevId: 334796954
2020-10-01 05:58:50 -07:00
A. Unique TensorFlower 049ca060a1 [MLIR][KernelGen] Legalize `atan2` to approximation
Legalize `atan2` analogously to XLA.  `atan2` is first reduced to `atan` on the
interval [-1, 1] and subsequently approximated.  This CL also adds e2e tests for
trigonometric approximations.

PiperOrigin-RevId: 334794336
2020-10-01 05:34:48 -07:00
A. Unique TensorFlower 4b1809784a Support collapse_slice_dims in the mhlo.gather->mhlo.slice canonicalizer
PiperOrigin-RevId: 334774763
2020-10-01 02:46:49 -07:00
Tres Popp ae51900562 Integrate LLVM at llvm/llvm-project@ce5379f0f0
Updates LLVM usage to match
[ce5379f0f067](https://github.com/llvm/llvm-project/commit/ce5379f0f067)

PiperOrigin-RevId: 334774614
2020-10-01 02:45:28 -07:00
Rahul Joshi bce128b070 Introduce CustomCall operation in LHLO Dialect
- And add conversion from MHLO CustomCall to LHLO CustomCall
- According to XLA documentation, the called function should not be side effecting,
  so marking the argument MemRefs as MemRead.

PiperOrigin-RevId: 334737196
2020-09-30 20:56:18 -07:00
A. Unique TensorFlower e2ffba3f61 Integrate LLVM at llvm/llvm-project@700e63293e
Updates LLVM usage to match
[700e63293eea](https://github.com/llvm/llvm-project/commit/700e63293eea)

PiperOrigin-RevId: 334732681
2020-09-30 20:13:43 -07:00
Benjamin Kramer dfe64d3958 Implement InferShapedTypeOpInterface for mhlo.complex
Binary companion for 8bcd33e4b7

PiperOrigin-RevId: 334651523
2020-09-30 12:14:15 -07:00
Tres Popp 019c5ef106 Integrate LLVM at llvm/llvm-project@8c05c7c8d8
Updates LLVM usage to match
[8c05c7c8d87c](https://github.com/llvm/llvm-project/commit/8c05c7c8d87c)

PiperOrigin-RevId: 334598568
2020-09-30 07:57:41 -07:00
Benjamin Kramer c8919f8419 Implement InferShapedTypeOpInterface and use inferReturnTypes for mhlo.imag and mhlo.real
This makes the lhlo lowering work with dynamic shapes.

PiperOrigin-RevId: 334553472
2020-09-30 02:02:26 -07:00
Ahmed S. Taei 39389587d2 {mhlo.is_finite, lmhlo.is_finite} -> linalg.generic conversion
PiperOrigin-RevId: 334414295
2020-09-29 10:50:42 -07:00
Benjamin Kramer 336ee14538 Make lmhlo.sign to linalg lowering work for more floating point and integer types
PiperOrigin-RevId: 334400341
2020-09-29 09:52:13 -07:00
Tres Popp 04bf09382e Integrate LLVM at llvm/llvm-project@eb9f7c28e5
Updates LLVM usage to match
[eb9f7c28e5fe](https://github.com/llvm/llvm-project/commit/eb9f7c28e5fe)

PiperOrigin-RevId: 334388404
2020-09-29 08:54:26 -07:00
Benjamin Kramer 6459f12235 Lower mhlo.not to a xor with all ones
PiperOrigin-RevId: 334361499
2020-09-29 05:59:40 -07:00
Robert Suderman 26ac5baae4 Make mhlo.sort return variadic results instead of a tuple
Tuple is only used on XLA's sort to return multiple inputs. MLIR supports
multiple inputs, switch to a tuple return.

PiperOrigin-RevId: 334226937
2020-09-28 13:32:23 -07:00
A. Unique TensorFlower be2ffd2e21 Integrate LLVM at llvm/llvm-project@6caf3fb817
Updates LLVM usage to match
[6caf3fb81786](https://github.com/llvm/llvm-project/commit/6caf3fb81786)

PiperOrigin-RevId: 333820612
2020-09-25 15:28:22 -07:00
A. Unique TensorFlower eec7eb72fc Integrate LLVM at llvm/llvm-project@81a408808f
Updates LLVM usage to match
[81a408808f66](https://github.com/llvm/llvm-project/commit/81a408808f66)

PiperOrigin-RevId: 333600462
2020-09-24 14:37:27 -07:00
A. Unique TensorFlower 9125701a38 Integrate LLVM at llvm/llvm-project@ada1e2ffa1
Updates LLVM usage to match
[ada1e2ffa117](https://github.com/llvm/llvm-project/commit/ada1e2ffa117)

PiperOrigin-RevId: 333566305
2020-09-24 12:02:43 -07:00
Alexander Belyaev 4ddca0cd03 Integrate LLVM at llvm/llvm-project@a90d72127a
Updates LLVM usage to match
[a90d72127a81](https://github.com/llvm/llvm-project/commit/a90d72127a81)

PiperOrigin-RevId: 333488152
2020-09-24 04:27:08 -07:00
Alexander Belyaev 2e142a685c Integrate LLVM at llvm/llvm-project@beeceb92c0
Updates LLVM usage to match
[beeceb92c082](https://github.com/llvm/llvm-project/commit/beeceb92c082)

PiperOrigin-RevId: 333459746
2020-09-24 00:34:31 -07:00
Ahmed S. Taei 9c6640cbb6 Only apply GeneralDotOpLoweringPatterns for static shaped inputs
PiperOrigin-RevId: 333439680
2020-09-23 21:42:01 -07:00
A. Unique TensorFlower 34c6844dcc Integrate LLVM at llvm/llvm-project@af1d3e6559
Updates LLVM usage to match
[af1d3e655991](https://github.com/llvm/llvm-project/commit/af1d3e655991)

PiperOrigin-RevId: 333385949
2020-09-23 15:31:15 -07:00
Robert Suderman 233f1a8a1a Folders for mhlo.compare
Constant evaluation of compare for the case where inputs are either the same
variable or the values are constant.

PiperOrigin-RevId: 333342328
2020-09-23 12:03:48 -07:00
A. Unique TensorFlower 0259f982bf Integrate LLVM at llvm/llvm-project@2d0de5f9a4
Updates LLVM usage to match
[2d0de5f9a4c5](https://github.com/llvm/llvm-project/commit/2d0de5f9a4c5)

PiperOrigin-RevId: 333341699
2020-09-23 12:01:39 -07:00
A. Unique TensorFlower 08e0d09463 [MLIR][KernelGen] Rename `legalize-tanh-to-approximation` to `legalize-trigonometric-to-approximation`
To add more approximation lowerings in the future, generalize the pass name.

PiperOrigin-RevId: 333340075
2020-09-23 11:53:45 -07:00
A. Unique TensorFlower e13904c92a Integrate LLVM at llvm/llvm-project@d6ac649ccd
Updates LLVM usage to match
[d6ac649ccda2](https://github.com/llvm/llvm-project/commit/d6ac649ccda2)

PiperOrigin-RevId: 333316098
2020-09-23 10:10:39 -07:00
Rahul Joshi 3ca740103d [NFC] Specify "reifyReturnTypeShapes" in DeclareOpInterfaceMethod overridenMethods
- This causes declaration of reifyReturnTypeShapes to be inserted in the TableGen
  generated code without explicitly adding it in extraClassDeclaration.

PiperOrigin-RevId: 333315601
2020-09-23 10:08:32 -07:00
Rahul Joshi 87d9e6951e [MLIR] Use MLIR provided 0DTensorOf/1DTensorOf instead of custom constraints.
- Use MLIR provided constraints for HLO_ScalarIntTensor and HLO_DimensionTensor.
- Update unit tests to expect new error messages.

PiperOrigin-RevId: 333313131
2020-09-23 09:57:12 -07:00
Rahul Joshi 7d01a60de8 [NFC] Fix typos in comments.
PiperOrigin-RevId: 333311070
2020-09-23 09:46:02 -07:00
A. Unique TensorFlower 08514eaa5f [MLIR][KernelGen] Add E2E tests for `tf.Tan` and `tf.Sinh`
PiperOrigin-RevId: 333275089
2020-09-23 05:50:54 -07:00
A. Unique TensorFlower be409a2409 Integrate LLVM at llvm/llvm-project@f212122150
Updates LLVM usage to match
[f21212215031](https://github.com/llvm/llvm-project/commit/f21212215031)

PiperOrigin-RevId: 333168406
2020-09-22 15:08:10 -07:00
A. Unique TensorFlower 3e3bc705ed Integrate LLVM at llvm/llvm-project@079757b551
Updates LLVM usage to match
[079757b551f3](https://github.com/llvm/llvm-project/commit/079757b551f3)

PiperOrigin-RevId: 333132011
2020-09-22 12:12:05 -07:00
Benjamin Kramer dd92c8ef61 Integrate LLVM at llvm/llvm-project@7e78d89052
Updates LLVM usage to match
[7e78d89052b1](https://github.com/llvm/llvm-project/commit/7e78d89052b1)

PiperOrigin-RevId: 333090785
2020-09-22 09:08:23 -07:00
Mehdi Amini 7abd557a61 Add a header for table-gen generated pass for MHLO and use it in SinkConstantsToControlFlowPass
A non globally registered pass should define `getName()` in order to generate correct crash reproducers.
This is something we get "for free" when using the TableGen generated base class.
We should also migrate the other passes to the same mechanism and remove the static
global registration.

PiperOrigin-RevId: 332976907
2020-09-21 18:01:57 -07:00
A. Unique TensorFlower 0bb017098a Integrate LLVM at llvm/llvm-project@93fd30bac3
Updates LLVM usage to match
[93fd30bac334](https://github.com/llvm/llvm-project/commit/93fd30bac334)

PiperOrigin-RevId: 332436415
2020-09-18 06:05:49 -07:00
A. Unique TensorFlower 4002077261 [MLIR][KernelGen] Lower `tf.Sinh` to MLHLO
PiperOrigin-RevId: 332425724
2020-09-18 04:27:07 -07:00
A. Unique TensorFlower cfbd7a18b2 Integrate LLVM at llvm/llvm-project@c0e7f64685
Updates LLVM usage to match
[c0e7f6468578](https://github.com/llvm/llvm-project/commit/c0e7f6468578)

PiperOrigin-RevId: 332420028
2020-09-18 03:30:34 -07:00
A. Unique TensorFlower 2fbbbe9cf1 [MLIR][KernelGen] Lower `tf.Acos` to LMHLO.
- Add ranked code generation for `mhlo.compare/select`
- Add bufferization for `tensor_cast`
- Add lowerings for `Atan2Op`

PiperOrigin-RevId: 332407734
2020-09-18 01:40:18 -07:00