| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR] Fix empty optional access in DialectConversion (#168331) When both MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS and MLIR multithreading are enabled, topLevelFingerPrint is empty but its value is accessed. This adds a has_value() check before dereferencing the optional. | 8 个月前 | |
[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] 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][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][Transforms] Remove UB dialect dependency from Canonicalizer pass (#150555) The Canonicalizer pass has a dependency to UB dialect which shouldn't have. It also no longer needs to directly depend on the UB dialect since the Vector dialect (which uses UB dialect for poison index operations introduced by 35df525) already declares this dependency(878d3594). | 1 年前 | |
[MLIR] Apply clang-tidy fixes for llvm-qualified-auto in CompositePass.cpp (NFC) | 10 个月前 | |
[mlir] Remove Transforms/SideEffectUtils.h and move the methods into Interface/SideEffectInterfaces.h. The methods in SideEffectUtils.h (and their implementations in SideEffectUtils.cpp) seem to have similar intent to methods already existing in SideEffectInterfaces.h. Move the decleration (and implementation) from SideEffectUtils.h (and SideEffectUtils.cpp) into SideEffectInterfaces.h (and SideEffectInterface.cpp). Also drop the SideEffectInterface::hasNoEffect method in favor of mlir::isMemoryEffectFree which actually recurses into the operation instead of just relying on the hasRecursiveMemoryEffectTrait exclusively. Differential Revision: https://reviews.llvm.org/D137857 | 3 年前 | |
[MLIR] Fix test failures for generate-runtime-verification pass from PR #160331 (#162533) [MLIR] Fix test failures for generate-runtime-verification pass from PR #160331 PR #160331 introduced a mistake that removed the error message for generate-runtime-verification pass, leading to test failures during test-build-check-mlir-build-only-check-mlir. This patch restores the missing error message. In addition, for related tests, the op strings used in FileChecks are updated with the same op formats as used in input mlirs. Verified locally. Fixes post-merge regression from: https://github.com/llvm/llvm-project/pull/160331 | 9 个月前 | |
NFC: remove some instances of deprecated capture (#154884) warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture] Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com> | 11 个月前 | |
[mlir][Transforms] Make LocationSnapshotPass respect OpPrintingFlags (#119373) The current implementation of LocationSnapshotPass takes an OpPrintingFlags argument and stores it as member, but does not use it for printing. Properly implement the printing flags, also supporting command line args. --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com> | 1 年前 | |
[mlir] Remove unused includes (NFC) (#146278) 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] Apply clang-tidy fixes for llvm-qualified-auto in Mem2Reg.cpp (NFC) | 10 个月前 | |
[mlir] Remove unused includes (NFC) (#150476) 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 年前 | |
Add missing newlines at EOF; NFC | 1 年前 | |
[mlir] Make remove-dead-values remove block and successorOperands before delete ops (#166766) Reland https://github.com/llvm/llvm-project/pull/165725, fix the Failed test by removing successor operands before delete operations. Following the deletion of cond.branch, its successor operands will subsequently be removed. | 8 个月前 | |
[MLIR] Erase location of folded constants (#75415) Follow up to the discussion from #75258, and serves as an alternate solution for #74670. Set the location to Unknown for deduplicated / moved / materialized constants by OperationFolder. This makes sure that the folded constants don't end up with an arbitrary location of one of the original ops that became it, and that hoisted ops don't confuse the stepping order. | 2 年前 | |
[MLIR] Adopt LDBG() macro in mlir/lib/Transforms/... (NFC) | 11 个月前 | |
[mlir] Remove unused includes (NFC) (#146278) 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] Adopt LDBG() macro debugging in SymbolDCE.cpp (NFC) (#155090) | 11 个月前 | |
[MLIR] Update pass declarations to new autogenerated files The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure. Reviewed By: mehdi_amini, rriddle Differential Review: https://reviews.llvm.org/D132838 | 3 年前 | |
[MLIR][Analysis] Consolidate topological sort utilities (#92563) This PR attempts to consolidate the different topological sort utilities into one place. It adds them to the analysis folder because the SliceAnalysis uses some of these. There are now two different sorting strategies: 1. Sort only according to SSA use-def chains 2. Sort while taking regions into account. This requires a much more elaborate traversal and cannot be applied on graph regions that easily. This additionally reimplements the region aware topological sorting because the previous implementation had an exponential space complexity. I'm open to suggestions on how to combine this further or how to fuse the test passes. | 2 年前 | |
[MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in ViewOpGraph.cpp (NFC) | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 9 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 9 个月前 |