| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR] Apply clang-tidy fixes for performance-unnecessary-copy-initialization in InferIntRangeCommon.cpp (NFC) | 9 个月前 | |
[mlir] Introduce AlignmentAttrOpInterface to expose MaybeAlign (#161440) Introduce a common interface for operations with alignment attributes across MemRef, Vector, and SPIRV dialects. The interface exposes getMaybeAlign() to retrieve alignment as llvm::MaybeAlign. This is the second part of the PRs addressing issue #155677. Co-authored-by: Erick Ochoa Lopez <erick.ochoalopez@amd.com> | 8 个月前 | |
[mlir] Introduce AlignmentAttrOpInterface to expose MaybeAlign (#161440) Introduce a common interface for operations with alignment attributes across MemRef, Vector, and SPIRV dialects. The interface exposes getMaybeAlign() to retrieve alignment as llvm::MaybeAlign. This is the second part of the PRs addressing issue #155677. Co-authored-by: Erick Ochoa Lopez <erick.ochoalopez@amd.com> | 8 个月前 | |
[mlir] share argument attributes interface between calls and callables (#123176) This patch shares core interface methods dealing with argument and result attributes from CallableOpInterface with the CallOpInterface and makes them mandatory to gives more consistent guarantees about concrete operations using these interfaces. This allows adding argument attributes on call like operations, which is sometimes required to get proper ABI, like with llvm.call (and llvm.invoke). The patch adds optional arg_attrs and res_attrs attributes to operations using these interfaces that did not have that already. They can then re-use the common "rich function signature" printing/parsing helpers if they want (for the LLVM dialect, this is done in the next patch). Part of RFC: https://discourse.llvm.org/t/mlir-rfc-adding-argument-and-result-attributes-to-llvm-call/84107 | 1 年前 | |
[mlir][IR][NFC] Move CastOpInterface helpers to mlir/Interfaces These helpers should not be part of the IR build unit. The interface is now implemented on builtin.unrealized_conversion_cast with an external model. Also rename the CastOpInterfaces Bazel target name to CastInterfaces to be consistent with the CMake target name. Differential Revision: https://reviews.llvm.org/D146972 | 3 年前 | |
[mlir] [NFC] Remove stray debug statement (#166696) Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com> | 8 个月前 | |
[mlir] Simplify unreachable type switch cases. NFC. (#162032) Use DefaultUnreachable from https://github.com/llvm/llvm-project/pull/161970. | 9 个月前 | |
[mlir] Add derived attribute op interface Interface provides uniform access to the the derived attribute query method. | 6 年前 | |
[mlir][Interfaces] DestinationStyleOpInterface: Rename hasTensor/BufferSemantics (#77574) Rename interface functions as follows: * hasTensorSemantics -> hasPureTensorSemantics * hasBufferSemantics -> hasPureBufferSemantics These two functions return "true" if the op has tensor/buffer operands but not buffer/tensor operands. Also drop the "ranked" part from the interface, i.e., do not distinguish between ranked/unranked types. The new function names describe the functions more accurately. They also align their semantics with the notion of "tensor semantics" with the bufferization framework. (An op is supposed to be bufferized if it has tensor operands, and we don't care if it also has memref operands.) This change is in preparation of #75273, which adds BufferizableOpInterface::hasTensorSemantics. By renaming the functions in the DestinationStyleOpInterface, we can avoid name clashes between the two interfaces. | 2 年前 | |
[mlir] share argument attributes interface between calls and callables (#123176) This patch shares core interface methods dealing with argument and result attributes from CallableOpInterface with the CallOpInterface and makes them mandatory to gives more consistent guarantees about concrete operations using these interfaces. This allows adding argument attributes on call like operations, which is sometimes required to get proper ABI, like with llvm.call (and llvm.invoke). The patch adds optional arg_attrs and res_attrs attributes to operations using these interfaces that did not have that already. They can then re-use the common "rich function signature" printing/parsing helpers if they want (for the LLVM dialect, this is done in the next patch). Part of RFC: https://discourse.llvm.org/t/mlir-rfc-adding-argument-and-result-attributes-to-llvm-call/84107 | 1 年前 | |
[mlir] Migrate away from ArrayRef(std::nullopt) (NFC) (#145140) ArrayRef has a constructor that accepts std::nullopt. This constructor dates back to the days when we still had llvm::Optional. Since the use of std::nullopt outside the context of std::optional is kind of abuse and not intuitive to new comers, I would like to move away from the constructor and eventually remove it. This patch takes care of the mlir side of the migration, starting with straightforward places like "return std::nullopt;" and ternally expressions involving std::nullopt. | 1 年前 | |
[mlir][Interface] Factor out common IndexingMapOpInterface behavior in a new generic interface (#145313) Refactor the verifiers to make use of the common bits and make vector.contract also use this interface. In the process, the confusingly named getStaticShape has disappeared. Note: the verifier for IndexingMapOpInterface is currently called manually from other verifiers as it was unclear how to avoid it taking precedence over more meaningful error messages | 1 年前 | |
Reland "[mlir] Add strided metadata range dataflow analysis" (#163403)" (#163408) This relands commit aa8499863ad23350da0912d99d189f306d0ea139. That commit was originally reverted because it caused failures in shared lib builds due to missing link dependencies. This patch relands the commit with the missing libs added. Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> | 9 个月前 | |
Reland "[mlir] Add strided metadata range dataflow analysis" (#163403)" (#163408) This relands commit aa8499863ad23350da0912d99d189f306d0ea139. That commit was originally reverted because it caused failures in shared lib builds due to missing link dependencies. This patch relands the commit with the missing libs added. Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> | 9 个月前 | |
[mlir][Interfaces] Add interface methods to allow reifying single result/single dim of result. (#162924) Current implementation of reifyResultShapes forces all implementations to return all dimensions of all results. This can be wasteful when you only require dimensions of one result, or a single dimension of a result. Further this also creates issues with using patterns to resolve the tensor.dim and memref.dim operations since the extra operations created result in the pattern rewriter entering an infinite loop (eventually breaking out of the loop due to the iteration limit on the pattern rewriter). This is demonstrated by some of the test cases added here that hit this limit when using --resolve-shaped-type-result-dims and --resolve-ranked-shaped-type-result-dims. To resolve this issue the interface should allow for creating just the operations needed. This change is the first step in resolving this. The original implementation was done with the restriction in mind that it might not always be possible to compute dimension of a single result or one dimension of a single result in all cases. To account for such cases, two additional interface methods are added - reifyShapeOfResult (which allows reifying dimensions of just one result), has a default implementation that calls reifyResultShapes and returns the dimensions of a single result. - reifyDimOfResult (which allows reifying a single dimension of a single result) has a default implementation that calls reifyDimOfResult and returns the value for the dimension of the result (which in turn for the default case would call reifyDimOfResult). While this change sets up the interface, ideally most operations will implement the refiyDimOfResult when possible. For almost all operations in tree this is true. Subsequent commits will change those incrementally. Some of the tests added here that check that the default implementations for the above method work as expected, also end up hitting the pattern rewriter limit when using --resolve-ranked-shaped-type-result-dims/ --resolve-ranked-shaped-type-result-dims. For testing purposes, a flag is added to these passes that ignore the error returned by the pattern application (this flag is left on by default to maintain current state). Changes required downstream to integrate this change 1. In operation definitions in .td files, for those operations that implement the ReifyRankedShapedTypeOpInterface. def <op-name> : Op<..., [..., DeclareOpInterfaceMethods[ReifyRankedShapedTypeOpInterface]]> should be changed to def <op-name> : Op<..., [..., DeclareOpInterfaceMethods[ReifyRankedShapedTypeOpInterface, [ "reifyResultShapes"]]]> --------- Signed-off-by: MaheshRavishankar <mahesh.ravishankar@gmail.com> | 8 个月前 | |
[mlir] Remove unused includes (NFC) (#148872) These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures. | 1 年前 | |
[mlir] Implement a memory-space cast bubbling-down transform (#159454) This commit adds functionality to bubble down memory-space casts operations, allowing consumer operations to use the original memory-space rather than first casting to a different memory space. Changes: - Introduce MemorySpaceCastOpInterface to handle memory-space cast operations - Create a MemorySpaceCastConsumerOpInterface pass that identifies and bubbles down eligible casts - Add implementation for memref and vector operations to handle memory-space cast propagation - Add bubbleDownCasts method to relevant operations to support the fusion In particular, in the current implementation only memory-space casts into the default memory-space can be bubbled-down. Example: mlir func.func @op_with_cast_sequence(%arg0: memref<4x4xf32, 1>, %arg1: index, %arg2: f32) -> memref<16xf32> { %memspacecast = memref.memory_space_cast %arg0 : memref<4x4xf32, 1> to memref<4x4xf32> %c0 = arith.constant 0 : index %c4 = arith.constant 4 : index %expanded = memref.expand_shape %memspacecast [[0], [1, 2]] output_shape [4, 2, 2] : memref<4x4xf32> into memref<4x2x2xf32> %collapsed = memref.collapse_shape %expanded [[0, 1, 2]] : memref<4x2x2xf32> into memref<16xf32> %loaded = memref.load %collapsed[%c0] : memref<16xf32> %added = arith.addf %loaded, %arg2 : f32 memref.store %added, %collapsed[%c0] : memref<16xf32> %atomic_result = memref.atomic_rmw addf %arg2, %collapsed[%c4] : (f32, memref<16xf32>) -> f32 return %collapsed : memref<16xf32> } // mlir-opt --bubble-down-memory-space-casts func.func @op_with_cast_sequence(%arg0: memref<4x4xf32, 1>, %arg1: index, %arg2: f32) -> memref<16xf32> { %c4 = arith.constant 4 : index %c0 = arith.constant 0 : index %expand_shape = memref.expand_shape %arg0 [[0], [1, 2]] output_shape [4, 2, 2] : memref<4x4xf32, 1> into memref<4x2x2xf32, 1> %collapse_shape = memref.collapse_shape %expand_shape [[0, 1, 2]] : memref<4x2x2xf32, 1> into memref<16xf32, 1> %memspacecast = memref.memory_space_cast %collapse_shape : memref<16xf32, 1> to memref<16xf32> %0 = memref.load %collapse_shape[%c0] : memref<16xf32, 1> %1 = arith.addf %0, %arg2 : f32 memref.store %1, %collapse_shape[%c0] : memref<16xf32, 1> %2 = memref.atomic_rmw addf %arg2, %collapse_shape[%c4] : (f32, memref<16xf32, 1>) -> f32 return %memspacecast : memref<16xf32> } --------- Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> Co-authored-by: Mehdi Amini <joker.eph@gmail.com> | 10 个月前 | |
[mlir] Add a generic SROA implementation. This revision introduces a generic implementation of Scalar Replacement Of Aggregates. In contrast to the implementation in LLVM, this focuses on the core of SROA: destructuring aggregates. By implementing interfaces on allocators and accessors, memory allocators can be destructured into smaller allocators, through the MemorySlot abstraction. This pass only works on aggregates that are accessed in a "type-safe" way, that is within the bounds and respecting the type of a given memory slot. The destructuring pattern and functions only peel off the first layer of aggregates and can safely be applied repeatedly. For convenience, the transformation is also available as a pass that will apply the pattern repeatedly. Depends on D149958 Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D150186 | 3 年前 | |
[MLIR] Add InParallelOpInterface for parallel combining operations (#157736) This commit: - Introduces a new InParallelOpInterface, along with the ParallelCombiningOpInterface, represent the parallel updating operations we have in a parallel loop of scf.forall. - Change the name of ParallelCombiningOpInterface to InParallelOpInterface as the naming was quite confusing. - ParallelCombiningOpInterface now is used to generalize operations that insert into shared tensors within parallel combining regions. Previously, only tensor.parallel_insert_slice was supported directly in scf.InParallelOp regions. - tensor.parallel_insert_slice now implements ParallelCombiningOpInterface. This change enables future extensions to support additional parallel combining operations beyond tensor.parallel_insert_slice, which have different update semantics, so the in_parallel region can correctly and safely represent these kinds of operation without potential mistakes such as races. Author credits: @qedawkins | 10 个月前 | |
[MLIR] Reuse AsmState to enable fast generate-runtime-verification pass; add location-only pass option (#160331) The pass generate-runtime-verification generates additional runtime op verification checks. Currently, the pass is extremely expensive. For example, with a mobilenet v2 ssd network(converted to mlir), running this pass alone in debug mode will take 30 minutes. The same observation has been made to other networks as small as 5 Mb. The culprit is this line "op->print(stream, flags);" in function "RuntimeVerifiableOpInterface::generateErrorMessage" in File mlir/lib/Interfaces/RuntimeVerifiableOpInterface.cpp. As we are printing the op with all the names of the operands in the middle end, we are constructing a new SSANameState for each op->print(...) call. Thus, we are doing a new SSA analysis for each error message printed. Perf profiling shows that 98% percent of the time is spent in the constructor of SSANameState. This change refactored the message generator. We use a toplevel AsmState, and reuse it with all the op-print(stream, asmState). With a release build, this change reduces the pass exeuction time from ~160 seconds to 0.3 seconds on my machine. This change also adds verbose options to generate-runtime-verification pass. verbose 0: print only source location with error message. verbose 1: print the full op, including the name of the operands. | 9 个月前 | |
[mlir][interfaces] Add ShapedDimOpInterface This interface is implemented by memref.dim and tensor.dim. This change makes it possible to remove a build dependency of the Affine dialect on the Tensor dialect (and maybe also the MemRef dialect in the future). Differential Revision: https://reviews.llvm.org/D133595 | 3 年前 | |
[mlir][Interfaces] Add hasUnknownEffects helper function (#154523) I have seen misuse of the hasEffect API in downstream projects: users sometimes think that hasEffect == false indicates that the operation does not have a certain memory effect. That's not necessarily the case. When the op does not implement the MemoryEffectsOpInterface, it is unknown whether it has the specified effect. "false" can also mean "maybe". This commit clarifies the semantics in the documentation. Also adds hasUnknownEffects and mightHaveEffect convenience functions. Also simplifies a few call sites. | 11 个月前 | |
[mlir][Interfaces] LISH: Add helpers for hyperrectangular subsets (#70628) The majority of subset ops operate on hyperrectangular subsets. This commit adds a new optional interface method ( getAccessedHyperrectangularSlice) that can be implemented by such subset ops. If implemented, the other operatesOn... interface methods of the SubsetOpInterface do not have to be implemented anymore. The comparison logic for hyperrectangular subsets (is disjoint/equivalent) is implemented with ValueBoundsOpInterface. This makes the subset hoisting more powerful: simple cases where two different SSA values always have the same runtime value can now be supported. | 2 年前 | |
[mlir:TiingInterface] Remove unnecessary include of Tensor.h Interfaces in Interfaces/ should not depend on any dialects, and this include is unnecessary anyways. | 4 年前 | |
[MLIR] Apply clang-tidy fixes for llvm-qualified-auto in ValueBoundsOpInterface.cpp (NFC) | 8 个月前 | |
Reland "[mlir][Vector] Re-define masking semantics in vector.transfer ops"" This relands commit 847b5f82a4a34218bf16d6f83f1b7c32df3117ba. Differential Revision: https://reviews.llvm.org/D138079 | 3 年前 | |
[mlir] ViewLikeInterface - verify ranks in verifyOffsetSizeAndStrideOp (#147926) getMixedOffsets() calls getMixedValues() with static_offsets and offsets. It is assumed that the number of dynamic offsets in static_offsets equals the rank of offsets. Otherwise, we fail on assert when trying to access an array out of its bounds. The same applies to getMixedStrides() and getMixedOffsets(). A verification of this assumption is added to verifyOffsetSizeAndStrideOp() and a clear assert is added in getMixedValues(). | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 9 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 1 年前 |