| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR] Introduce RemarkEngine + pluggable remark streaming (YAML/Bitstream) (#152474) This PR implements structured, tooling-friendly optimization remarks with zero cost unless enabled. It implements: - RemarkEngine collects finalized remarks within MLIRContext. - MLIRRemarkStreamerBase abstract class streams them to a backend. - Backends: MLIRLLVMRemarkStreamer (bridges to llvm::remarks → YAML/Bitstream) or your own custom streamer. - Optional mirroring to DiagnosticEngine (printAsEmitRemarks + categories). - Off by default; no behavior change unless enabled. Thread-safe; ordering best-effort. ## Overview Passes (reportOptimization*) │ ▼ +-------------------+ | RemarkEngine | collects +-------------------+ │ │ │ mirror │ stream ▼ ▼ emitRemark MLIRRemarkStreamerBase (abstract) │ ├── MLIRLLVMRemarkStreamer → llvm::remarks → YAML | Bitstream └── CustomStreamer → your sink ## Enable Remark engine and Plug LLVM's Remark streamer `` // Enable once per MLIRContext. This uses MLIRLLVMRemarkStreamer mlir::remark::enableOptimizationRemarksToFile( ctx, path, llvm::remarks::Format::YAML, cats); ## API to emit remark // Emit from a pass remark::passed(loc, categoryVectorizer, myPassname1) << "vectorized loop"; remark::missed(loc, categoryUnroll, "MyPass") << remark::reason("not profitable at this size") // Creates structured reason arg << remark::suggest("increase unroll factor to >=4"); // Creates structured suggestion arg remark::passed(loc, categoryVectorizer, myPassname1) << "vectorized loop" << remark::metric("tripCount", 128); // Create structured metric on-the-fly `` | 11 个月前 | |
[MLIR] Implement remark emitting policies in MLIR (#161202) This update introduces two new remark emitting policies: 1. RemarkEmittingPolicyAll, which emits all remarks, 2. RemarkEmittingPolicyFinal, which only emits final remarks after processing. The RemarkEngine is modified to support these policies, allowing for more flexible remark handling based on user configuration. PR also adds flag to mlir-opt --remark-policy=<value> - Specify the policy for remark output. =all - Print all remarks =final - Print final remarks Relanding https://github.com/llvm/llvm-project/pull/160526 This PR requires RemarkEngine to be finalize manually. So here is usage: MLIRContext ctx; ctx.setRemarkEngine(...) ... ctx.getRemarkEngine().shutdown() <-- PR adds this, it is required when the emission policy is final | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 11 个月前 | ||
| 9 个月前 |