Commit graph

421 commits

Author SHA1 Message Date
Alex Zinenko f63f5a228f [mlir] clarify LangRef wording around control flow in regions
It was unclear what "exiting a region" meant in the existing formulation.
Phrase it in terms of control flow transfer to the operation enclosing the
region.

Discussion: https://groups.google.com/a/tensorflow.org/d/msg/mlir/73d2O8gjTuA/xVj1KoCTBAAJ
2020-01-20 14:29:57 +01:00
Kazuaki Ishizaki fc817b09e2 [mlir] NFC: Fix trivial typos in comments
Differential Revision: https://reviews.llvm.org/D73012
2020-01-20 03:17:03 +00:00
Rainer Orth 002ec79f97 [mlir] NFC: Rename index_t to index_type
mlir currently fails to build on Solaris:

  /vol/llvm/src/llvm-project/dist/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp:78:20: error: reference to 'index_t' is ambiguous
    IndexHandle zero(index_t(0)), one(index_t(1));
                     ^
  /usr/include/sys/types.h:103:16: note: candidate found by name lookup is 'index_t'
  typedef short           index_t;
                          ^
  /vol/llvm/src/llvm-project/dist/mlir/include/mlir/EDSC/Builders.h:27:8: note: candidate found by name lookup is 'mlir::edsc::index_t'
  struct index_t {
         ^

and many more.

Given that POSIX reserves all identifiers ending in `_t` 2.2.2 The Name Space <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>, it seems
quite unwise to use such identifiers in user code, even more so without a distinguished
prefix.

The following patch fixes this by renaming `index_t` to `index_type`.
cases.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D72619
2020-01-18 22:10:46 +01:00
Hiroshi Inoue 58265ad42a [mlir] fix broken links to Glossary
Differential Revision: https://reviews.llvm.org/D72697
2020-01-16 14:15:34 +09:00
Jacques Pienaar fa26a37d36 [mlir] Add shaped container component type interface
Summary:
* Add shaped container type interface which allows infering the shape, element
  type and attribute of shaped container type separately. Show usage by way of
  tensor type inference trait which combines the shape & element type in
  infering a tensor type;
  - All components need not be specified;
  - Attribute is added to allow for layout attribute that was previously
    discussed;
* Expand the test driver to make it easier to test new creation instances
  (adding new operands or ops with attributes or regions would trigger build
  functions/type inference methods);
  - The verification part will be moved out of the test and to verify method
    instead of ops implementing the type inference interface in a follow up;
* Add MLIRContext as arg to possible to create type for ops without arguments,
  region or location;
* Also move out the section in OpDefinitions doc to separate ShapeInference doc
  where the shape function requirements can be captured;
  - Part of this would move to the shape dialect and/or shape dialect ops be
    included as subsection of this doc;
* Update ODS's variable usage to match camelBack format for builder,
  state and arg variables;
  - I could have split this out, but I had to make some changes around
    these and the inconsistency bugged me :)

Differential Revision: https://reviews.llvm.org/D72432
2020-01-15 13:28:39 -08:00
Lei Zhang 47c6ab2b97 [mlir][spirv] Properly support SPIR-V conversion target
This commit defines a new SPIR-V dialect attribute for specifying
a SPIR-V target environment. It is a dictionary attribute containing
the SPIR-V version, supported extension list, and allowed capability
list. A SPIRVConversionTarget subclass is created to take in the
target environment and sets proper dynmaically legal ops by querying
the op availability interface of SPIR-V ops to make sure they are
available in the specified target environment. All existing conversions
targeting SPIR-V is changed to use this SPIRVConversionTarget. It
probes whether the input IR has a `spv.target_env` attribute,
otherwise, it uses the default target environment: SPIR-V 1.0 with
Shader capability and no extra extensions.

Differential Revision: https://reviews.llvm.org/D72256
2020-01-14 19:18:42 -05:00
Daniel Galvez a7cac2bd4b [MLIR] Fix broken link locations after move to monorepo
I used the codemod python tool to do this with the following commands:

codemod 'tensorflow/mlir/blob/master/include' 'llvm/llvm-project/blob/master/mlir/include'
codemod 'tensorflow/mlir/blob/master' 'llvm/llvm-project/blob/master/mlir'
codemod 'tensorflow/mlir' 'llvm-project/llvm'

Differential Revision: https://reviews.llvm.org/D72244
2020-01-14 07:15:02 +00:00
River Riddle 4268e4f4b8 [mlir] Change the syntax of AffineMapAttr and IntegerSetAttr to avoid conflicts with function types.
Summary: The current syntax for AffineMapAttr and IntegerSetAttr conflict with function types, making it currently impossible to round-trip function types(and e.g. FuncOp) in the IR. This revision changes the syntax for the attributes by wrapping them in a keyword. AffineMapAttr is wrapped with `affine_map<>` and IntegerSetAttr is wrapped with `affine_set<>`.

Reviewed By: nicolasvasilache, ftynse

Differential Revision: https://reviews.llvm.org/D72429
2020-01-13 13:24:39 -08:00
River Riddle 2bdf33cc4c [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed.
Summary: These were temporary methods used to simplify the transition.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D72548
2020-01-11 08:54:39 -08:00
Nico Weber 01662aeb5d fix another typo to cycle bots 2020-01-09 23:36:34 -05:00
MaheshRavishankar 8aae6455c0 [mlir][spirv] Update SPIR-V documentation with information about
lowering to SPIR-V dialect.

Add information about
- SPIRVTypeConverter
- SPIRVOpLowering
- Utility functions used in lowering to SPIR-V dialect.
2020-01-05 23:05:37 -08:00
Nicolas Vasilache a932f033a3 [mlir][Vector] NFC - Add documentation for the VectorOps dialect. 2020-01-03 13:14:24 -05:00
Kazuaki Ishizaki a050327064 [mlir] NFC: Fix broken links in docs
Summary: This commit fixes missing links that are caused by the repository movement.

Reviewers: Jim, rriddle, jpienaar

Reviewed By: Jim, rriddle, jpienaar

Subscribers: arpith-jacob, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72065
2020-01-03 10:26:27 +08:00
Nico Weber 846bf1d43f fix doc grammar-o to cycle bots 2020-01-02 12:11:59 -05:00
Lei Zhang 5d38b2610f [mlir][spirv] Fix links in docs and update dialect docs
Summary:
This commit fixes links to code directories and uses doc links on
mlir.llvm.org where possible. The docs in TableGen dialect definition
is also updated to reflect recent developments.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D72051
2020-01-01 22:39:51 -05:00
Jacques Pienaar 7544cb8807 [mlir][docs] Remove redundant path prefix
./ is not needed.
2019-12-31 11:03:40 -08:00
Jacques Pienaar 430bba2a0f [mlir] Make code blocks more consistent
Use the same form specification for the same type of code.
2019-12-31 09:54:16 -08:00
Lei Zhang 596012b256 [mlir][spirv] Update docs regarding how to define new ops and types
This commit expands on the steps of defining a new SPIR-V op and
also provides pointers on how to define a new SPIR-V specific type.

Differential Revision: https://reviews.llvm.org/D71928
2019-12-27 15:33:09 -05:00
Lei Zhang 69d85f805a [MLIR][spirv] Fix links in docs after repo migration
Summary:
This commit updates links to SPIR-V dialect code to LLVM monorepo
on GitHub. It also points to the operation doc on mlir.llvm.org.

Reviewers: mravishankar, denis13, ftynse

Reviewed By: ftynse

Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71926
2019-12-27 09:25:38 -05:00
Mehdi Amini c6a5534ea4 Remove static MLIR doc ; they are already on the website 2019-12-24 00:53:35 -08:00
Mehdi Amini 5b4a01d4a6 Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00