| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Revert "Implement Pass and Dialect plugins for mlir-opt" Breaks bot. This reverts commit d4c873b044aeebaa43e6989fb1f9606530ec60cf. | 3 年前 | |
| 1 年前 | ||
[mlir][Pass] Fix crash when applying a pass to an optional interface (#169262) Interfaces can be optional: whether an op implements an interface or not can depend on the state of the operation. `` // An optional code block for adding additional "classof" logic. This can // be used to better enable "optional" interfaces, where an entity only // implements the interface if some dynamic characteristic holds. // $_attr/$_op/$_type may be used to refer to an instance of the // interface instance being checked. code extraClassOf = ""; ` The current Pass::canScheduleOn(RegisteredOperationName) is insufficient. This commit adds an additional overload to inspect Operation *. This commit fixes a crash when scheduling an InterfacePass` for an optional interface on an operation that does not actually implement the interface. This is a re-upload of #168499, which was reverted. | 8 个月前 | |
[MLIR] Fix use-after-frees when accessing DistinctAttr storage (#148666) This PR fixes a use-after-free error that happens when DistinctAttr instances are created within a PassManager running with crash recovery enabled. The root cause is that DistinctAttr storage is allocated in a thread_local allocator, which is destroyed when the crash recovery thread joins, invalidating the storage. Moreover, even without crash reproduction disabling multithreading on the context will destroy the context's thread pool, and in turn delete the threadlocal storage. This means a call to ctx->disableMulthithreading() breaks the IR. This PR replaces the thread local allocator with a synchronised allocator that's shared between threads. This persists the lifetime of allocated DistinctAttr storage instances to the lifetime of the context. ### Problem Details: The DistinctAttributeAllocator uses a ThreadLocalCache<BumpPtrAllocator> for lock-free allocation of DistinctAttr storage in a multithreaded context. The issue occurs when a PassManager is run with crash recovery (runWithCrashRecovery), the pass pipeline is executed on a temporary thread spawned by llvm::CrashRecoveryContext. Any DistinctAttrs created during this execution have their storage allocated in the thread_local cache of this temporary thread. When the thread joins, the thread_local storage is destroyed, freeing the DistinctAttrs' memory. If this attribute is accessed later, e.g. when printing, it results in a use-after-free. As mentioned previously, this is also seen after creating some DistinctAttrs and then calling ctx->disableMulthithreading(). ### Solution DistinctAttrStorageAllocator uses a synchronised, shared allocator instead of one wrapped in a ThreadLocalCache. The former is what stores the allocator in transient thread_local storage. ### Testing: A C++ unit test has been added to validate this fix. (I was previously reproducing this failure with mlir-opt but I can no longer do so and I am unsure why.) ----- Note: This is a 2nd attempt at my previous PR https://github.com/llvm/llvm-project/pull/128566 that was reverted in https://github.com/llvm/llvm-project/pull/133000. I believe I've addressed the TSAN and race condition concerns. | 1 年前 | |
[mlir][Pass] Enable the option for reproducer generation without crashing (#75421) This PR adds API makeReproducer and cl::opt flag --mlir-generate-reproducer=<filename> in order to allow for mlir reproducer dumps even when the pipeline doesn't crash. This PR also decouples the code that handles generation of an MLIR reproducer from the crash recovery portion. The purpose is to allow for generating reproducers outside of the context of a compiler crash. This will be useful for frameworks and runtimes that use MLIR where it is needed to reproduce the pipeline behavior for reasons outside of diagnosing crashes. An example is for diagnosing performance issues using offline tools, where being able to dump the reproducer from a runtime compiler would be helpful. | 2 年前 | |
[MLIR] Print more user-friendly error message when generating local reproducer and threading is enabled (#144905) | 1 年前 | |
[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 年前 | |
[mlir] Migrate away from ArrayRef(std::nullopt) (NFC) (#144989) 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 where I see ArrayRef or ValueRange nearby. Note that ValueRange has a constructor that forwards arguments to an ArrayRef constructor. | 1 年前 | |
[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 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 |