| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR] Make the ConversionTarget const ref in the DialectConversion (NFC) It isn't mutated during the conversion already, communicate this through the API. Differential Revision: https://reviews.llvm.org/D157199 | 2 年前 | |
[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][Transforms][NFC] CSE: Add C++ entry point * All IR modifications are done with a rewriter. * The new C++ entry point takes a RewriterBase &, which may have a listener attached to it. This revision is useful because it allows users to run CSE and track IR modifications via a listener that can be attached to the rewriter. This is a reupload. The original CL was reverted (9979417d4db4) due to a memory leak. The memory leak is unrelated to this change and fixed with D154185. Differential Revision: https://reviews.llvm.org/D145226 | 2 年前 | |
Fix canonicalizer to copy the entire GreedyRewriteConfig instead of selected fields It is surprising for the user that only some fields were honored. Also make the FrozenRewritePatternSet a shared_ptr<const T>. Fixes #64543 Differential Revision: https://reviews.llvm.org/D157469 | 2 年前 | |
[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] Add RuntimeVerifiableOpInterface and transform Static op verification cannot detect cases where an op is valid at compile time but may be invalid at runtime. An example of such an op is memref::ExpandShapeOp. Invalid at compile time: memref.expand_shape %m [[0, 1]] : memref<11xf32> into memref<2x5xf32> Valid at compile time (because we do not know any better): memref.expand_shape %m [[0, 1]] : memref<?xf32> into memref<?x5xf32>. This op may or may not be valid at runtime depending on the runtime shape of %m. Invalid runtime ops such as the one above are hard to debug because they can crash the program execution at a seemingly unrelated position or (even worse) compute an invalid result without crashing. This revision adds a new op interface RuntimeVerifiableOpInterface that can be implemented by ops that provide additional runtime verification. Such runtime verification can be computationally expensive, so it is only generated on an opt-in basis by running -generate-runtime-verification. A simple runtime verifier for memref::ExpandShapeOp is provided as an example. Differential Revision: https://reviews.llvm.org/D138576 | 3 年前 | |
[mlir] Move casting calls from methods to function calls The MLIR classes Type/Attribute/Operation/Op/Value support cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast functionality in addition to defining methods with the same name. This change begins the migration of uses of the method to the corresponding function call as has been decided as more consistent. Note that there still exist classes that only define methods directly, such as AffineExpr, and this does not include work currently to support a functional cast/isa call. Context: - https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…" - Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443 Implementation: This patch updates all remaining uses of the deprecated functionality in mlir/. This was done with clang-tidy as described below and further modifications to GPUBase.td and OpenMPOpsInterfaces.td. Steps are described per line, as comments are removed by git: 0. Retrieve the change from the following to build clang-tidy with an additional check: main...tpopp:llvm-project:tidy-cast-check 1. Build clang-tidy 2. Run clang-tidy over your entire codebase while disabling all checks and enabling the one relevant one. Run on all header files also. 3. Delete .inc files that were also modified, so the next build rebuilds them to a pure state. ninja -C $BUILD_DIR clang-tidy run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\ -header-filter=mlir/ mlir/* -fix rm -rf $BUILD_DIR/tools/mlir/**/*.inc Differential Revision: https://reviews.llvm.org/D151542 | 3 年前 | |
[mlir] Use std::optional instead of llvm::Optional (NFC) This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 | 3 年前 | |
[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][llvm] Add memset support for mem2reg/sroa This revision introduces support for memset intrinsics in SROA and mem2reg for the LLVM dialect. This is achieved for SROA by breaking memsets of aggregates into multiple memsets of scalars, and for mem2reg by promoting memsets of single integer slots into the value the memset operation would yield. The SROA logic supports breaking memsets of static size operating at the start of a memory slot. The intended most common case is for memsets covering the entirety of a struct, most often as a way to initialize it to 0. The mem2reg logic supports dynamic values and static sizes as input to promotable memsets. This is achieved by lowering memsets into ceil(log_2(n)) LeftShift operations, ceil(log_2(n)) Or operations and up to one ZExt operation (for n the byte width of the integer), computing in registers the integer value the memset would create. Only byte-aligned integers are supported, more types could easily be added afterwards. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D152367 | 3 年前 | |
[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] Add label to print-ir pass Differential Revision: https://reviews.llvm.org/D145523 | 3 年前 | |
[mlir][Transforms][NFC] Improve builder/listener API of OperationFolder The constructor of OperationFolder takes a listener. Therefore, the remaining API should not take any builder/rewriters. This could lead to double notifications in case a listener is attached to the builder/rewriter. As an internal cleanup, OperationFolder now has an IRRewriter instead of a RewriterBase::Listener. In most cases, OperationFolder no longer has to notify/deal with listeners. This is done by the rewriter. Differential Revision: https://reviews.llvm.org/D146134 | 3 年前 | |
[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] 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/{SPIRV,Bufferization}: use std::optional in .td files (NFC) This is part of an effort to migrate from llvm::Optional to std::optional. 22426110c5ef changed the way mlir-tblgen generates .inc files, emitting std::optional when an Optional attribute is specified in a .td file. It also changed several .td files hard-coding llvm::Optional to use std::optional. However, the patch excluded a few .td files in SPIRV and Bufferization hard-coding llvm::Optional. This patch fixes that defect, and after this patch, references to llvm::Optional in .cpp and .h files can be replaced mechanically. See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Signed-off-by: Ramkumar Ramachandra <r@artagnon.com> Differential Revision: https://reviews.llvm.org/D140329 | 3 年前 | |
[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 年前 | |
[ADT][mlir][NFCI] Do not use non-const lvalue-refs with enumerate Replace references to enumerate results with either result_pairs (reference wrapper type) or structured bindings. I did not use structured bindings everywhere as it wasn't clear to me it would improve readability. This is in preparation to the switch to zip semantics which won't support non-const lvalue reference to elements: https://reviews.llvm.org/D144503. I chose to use values instead of const lvalue-refs because MLIR is biased towards avoiding const local variables. This won't degrade performance because currently result_pair is cheap to copy (size_t + iterator), and in the future, the enumerator iterator dereference will return temporaries anyway. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D146006 | 3 年前 | |
Improve MLIR "view-op-graph" to color operations according to their name Differential Revision: https://reviews.llvm.org/D153290 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 |