| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- the name was misleading; this is really checking if a Value being used
to index was loop IV invariant. Update comment.
- the method is only used locally; what can be exposed in the future is
isAccessInvariant(LoadOrStoreOp op, Value *iv)
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#285
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/285 from bondhugula:quickfix fe5837abe987980c4ab469a9aa7de8e4f0007d9f
PiperOrigin-RevId: 283771923
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283769736
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the replaceAllUsesExcept utility function called from loop coalescing the
iteration over the use-chain is incorrect. The use list nodes (IROperands) have
next/prev links, and bluntly resetting the use would make the loop to continue
on uses of the value that was replaced instead of the original one. As a
result, it could miss the existing uses and update the wrong ones. Make sure we
increment the iterator before updating the use in the loop body.
Reported-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#291.
PiperOrigin-RevId: 283754195
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#251
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/251 from dfki-jugr:new_ops 0398997bf9953016898f873068e22916a062eb2b
PiperOrigin-RevId: 283750699
|
| |
| |
| |
| |
| |
| |
| |
| | |
type lists and indexing maps to a target vector size.
Adds unit tests for unrolling the vector ContractionOp with different iteration orders.
PiperOrigin-RevId: 283747503
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#250
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/250 from kiszk:spelling_tweaks_201911 50fc04443723190b764e824b6fcd2469fecb56e6
PiperOrigin-RevId: 283733032
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283682865
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This CL refactors some of the MLIR vector dependencies to allow decoupling VectorOps, vector analysis, vector transformations and vector conversions from each other.
This makes the system more modular and allows extracting VectorToVector into VectorTransforms that do not depend on vector conversions.
This refactoring exhibited a bunch of cyclic library dependencies that have been cleaned up.
PiperOrigin-RevId: 283660308
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This CL also did the following cleanup:
- Moved the test for spv.SubgroupBallotKHR to its own file
- Wrapped generated canonicalization patterns in anonymous namespace
- Updated header comments in SPVOps.td
PiperOrigin-RevId: 283650091
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Not all StandardOps can be lowered to SPIR-V. For example, subview op
implementation requires use of pointer bitcasts which is not valid
according to SPIR-V spec (or at least is ambiguous about it). Such ops
need to be removed/transformed before lowering to SPIR-V. The
SPIRVLegalizationPass is added a place where such legalizations can be
added. Current implementation folds the subview ops with load/stores
so that the lowering itself does not have to convert a subview op.
PiperOrigin-RevId: 283642981
|
| |
| |
| |
| |
| |
| | |
This prints out in case of any pass failure. Not just a crash.
PiperOrigin-RevId: 283616719
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283591888
|
| |
| |
| |
| |
| |
| | |
In particular, print the successor number in the diagnostic.
PiperOrigin-RevId: 283585084
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
truly invalidated.
The hook has the following form:
* `bool isInvalidated(const AnalysisManager::PreservedAnalyses &)`
Given a preserved analysis set, the analysis returns true if it should truly be
invalidated. This allows for more fine-tuned invalidation in cases where an
analysis wasn't explicitly marked preserved, but may be preserved(or
invalidated) based upon other properties; such as analyses sets.
PiperOrigin-RevId: 283582889
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The SPIR-V lowering used nested !spv.arrays to represented
multi-dimensional arrays, with the hope that in-conjunction with the
layout annotations, the shape and layout of memref can be represented
directly. It is unclear though how portable this representation will
end up being. It will rely on driver compilers implementing complex
index computations faithfully. A more portable approach is to use
linearized arrays to represent memrefs and explicitly instantiate all
the index computation in SPIR-V. This gives added benefit that we can
further optimize the generated code in MLIR before generating the
SPIR-V binary.
PiperOrigin-RevId: 283571167
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283569325
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283561252
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As described in the documentation, ViewOp is expected to take an optional
dynamic offset followed by a list of dynamic sizes. However, the ViewOp parser
did not include a check for the offset being a single value and accepeted a
list of values instead.
Furthermore, several tests have been exercising the wrong syntax of a ViewOp,
passing multiple values to the dyanmic stride list, which was not caught by the
parser. The trailing values could have been erronously interpreted as dynamic
sizes. This is likely due to resyntaxing of the ViewOp, with the previous
syntax taking the list of sizes before the offset. Update the tests to use the
syntax with the offset preceding the sizes.
Worse, the conversion of ViewOp to the LLVM dialect assumed the wrong order of
operands with offset in the trailing position, and erronously relied on the
permissive parsing that interpreted trailing dynamic offset values as leading
dynamic sizes. Fix the lowering to use the correct order of operands.
PiperOrigin-RevId: 283532506
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
tensorflow/mlir#162 introduced a bug that
incorrectly allowed fusion of producer loops with multiple outgoing
edges. This commit fixes that problem. It also introduces a new flag to
disable sibling loop fusion so that we can test producer-consumer fusion
in isolation.
Closes tensorflow/mlir#259
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/259 from dcaballe:dcaballe/fix_multi_out_edge_producer_fusion 578d5661705fd5c56c555832d5e0528df88c5282
PiperOrigin-RevId: 283531105
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
stride
are constant (i.e., there are no size and stride operands).
We recently added canonicalization that rewrites constant size and stride operands to
SubViewOp into static information in the type, so these patterns now occur during code
generation.
PiperOrigin-RevId: 283524688
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283522284
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283503642
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A recent commit introduced the Linkage attribute to the LLVM dialect and used
it in the Global Op. Also use it in LLVMFuncOp. As per LLVM Language Reference,
if the linkage attribute is omitted, the function is assumed to have external
linkage.
PiperOrigin-RevId: 283493299
|
| |
| |
| |
| |
| |
| |
| | |
Put extensions and capabilities at the very beginning because
they will be referenced later by other definitions.
PiperOrigin-RevId: 283416972
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283392575
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283360101
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Existing builders generated by ODS require attributes to be passed
in as mlir::Attribute or its subclasses. This is okay foraggregate-
parameter builders, which is primarily to be used by programmatic
C++ code generation; it is inconvenient for separate-parameter
builders meant to be called in manually written C++ code because
it requires developers to wrap raw values into mlir::Attribute by
themselves.
This CL extends to generate additional builder methods that
take raw values for attributes and handles the wrapping in the
builder implementation. Additionally, if an attribute appears
late in the arguments list and has a default value, the default
value is supplied in the declaration if possible.
PiperOrigin-RevId: 283355919
|
| |
| |
| |
| |
| |
| | |
Also add a mlir-doc build target to general all the docs
PiperOrigin-RevId: 283353529
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#262
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/262 from brettkoonce:docs-sp 6833fc8aa41edd02d8bc7c3cbb84211cb8b0334c
PiperOrigin-RevId: 283352765
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#266
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/266 from denis0x0D:sandbox/miss_char a5f662e1bf103b5009da67d045ee2fcebf822ab0
PiperOrigin-RevId: 283340486
|
| |
| |
| |
| |
| |
| |
| |
| | |
Right now op argument matching in DRR is position-based, meaning we need to
specify N arguments for an op with N ODS-declared argument. This can be annoying
when we don't want to capture all the arguments. `$_` is to remedy the situation.
PiperOrigin-RevId: 283339992
|
| |
| |
| |
| |
| |
| | |
This turns a few manually written helper methods into auto-generated ones.
PiperOrigin-RevId: 283339617
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
add missing '>' in Ch-2
(tensor<2x3xf64)->(tensor<2x3xf64>)
Closes tensorflow/mlir#283
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/283 from JKIsaacLee:patch-1 b69fe8d51e2a540f7efaded159d35b88778ad159
PiperOrigin-RevId: 283333807
|
| |
| |
| |
| | |
PiperOrigin-RevId: 283328994
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
LLVM IR supports linkage on global objects such as global variables and
functions. Introduce the Linkage attribute into the LLVM dialect, backed by an
integer storage. Use this attribute on LLVM::GlobalOp and make it mandatory.
Implement parsing/printing of the attribute and conversion to LLVM IR.
See tensorflow/mlir#277.
PiperOrigin-RevId: 283309328
|
| |
| |
| |
| |
| |
| | |
Follow LLVM's tblgen convention when no generator is set instead of asserting.
PiperOrigin-RevId: 283073690
|
| |
| |
| |
| |
| |
| |
| |
| | |
* Had leftover call that would result in converting to dictionary attr before
being implicitedly converted back to NamedAttributeList;
* NamedAttributeList is value typed, so don't use const reference;
PiperOrigin-RevId: 283072576
|
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#282
PiperOrigin-RevId: 283064785
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
folding.
Closes tensorflow/mlir#281
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/281 from denis0x0D:sandbox/composite_ex_fold d02d73658bd1b9eaa515eb4e0aee34bc41d4252b
PiperOrigin-RevId: 282971563
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Helper utilies for parsing and printing FunctionLike Ops are only relevant to
the implementation of the Op, not its definition. They depend on
OpImplementation.h and increase the inclusion footprint of FunctionSupport.h,
and do so only to provide some utilities in the "impl" namespace. Move them to
a separate files, similarly to OpDefinition/OpImplementation distinction, and
make only Op implementations use them while keeping headers cleaner. NFC.
PiperOrigin-RevId: 282964556
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This addresses issue tensorflow/mlir#270. Linalg is updated to take the same form
of iterator_types than vector contraction.
Closes tensorflow/mlir#280
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/280 from tetuante:PRissue270 d26d88d090d3765d3b9884bfabdd023143f27287
PiperOrigin-RevId: 282905396
|
| |
| |
| |
| |
| |
| |
| | |
Updated comments and used static instead of anonymous namspace
to hide functions to be consistent with the existing codebase.
PiperOrigin-RevId: 282847784
|
| |
| |
| |
| |
| |
| |
| | |
Getting constant zero or one is very common so it merits a special handy
method on spirv::ConstantOp itself.
PiperOrigin-RevId: 282832572
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adding zero and multiplying one can be common when generating code
for index calculation.
This CL also sorted canonicalize.mlir to alphabetical order.
PiperOrigin-RevId: 282828055
|
| |
| |
| |
| | |
PiperOrigin-RevId: 282810649
|
| |
| |
| |
| |
| |
| | |
This CL rewrites the linalg ops to loops transformations as patterns that can be targeted directly from Tablegen. Reliance on OpFolder is removed and to cope with it we introduce local folding patterns that are applied greedily.
PiperOrigin-RevId: 282765550
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since second argument is always fully overwritten and
shape is define in "to" clause, it is not needed.
Also renamed "into" to "to" now that arg is dropped.
PiperOrigin-RevId: 282686475
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NamedAttributeList
This method is close to creating an OperationState first and then unpacking it
but avoids creating the OperationState and takes a NamedAttributeList for
attributes rather than array of NamedAttribute (to enable reusing an already
created NamedAttributeList).
Reuse this new method via create that takes OperationState. I'll update inferReturnTypes in follow up to also take NamedAttributeList and so a build method that uses both inferReturnTypes and create can reuse the same list.
PiperOrigin-RevId: 282651642
|
| |
| |
| |
| | |
PiperOrigin-RevId: 282643305
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#244
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/244 from DavidTruby:openmp 30e2638ee678188575dd5aeb3f7fa51d93369f5f
PiperOrigin-RevId: 282607397
|