Commit e4292d1
committed
[MLIR] MLIR Integrate LLVM Optimization Remarks Infrastructure
This patch hooks LLVM’s remarks infrastructure into MLIR.
* Disabled by default, zero-cost when off.
Enable per context with `MLIRContext::setupOptimizationRemarks(...)`.
* YAML or bitstream output: via new `MLIRRemarkStreamer`
(subclasses `llvm::remarks::RemarkStreamer`).
* Implements simple APIs for passes:
User-code can directly prints remarks like:
```
reportOptimizationPass(loc, categoryName, "MyPass") << "vectorized";
reportOptimizationMiss(loc, categoryLoopUnroll, "MyPass",
"try increasing unroll factor") << "...";
reportOptimizationFail(loc, categoryLoopUnroll, "MyPass") << "...";
reportOptimizationAnalysis(loc, categoryLoopUnroll, "MyPass")
<< "estimated trip count: " << tripCount;
```1 parent 5f86456 commit e4292d1
File tree
7 files changed
+913
-0
lines changed- mlir
- include/mlir/IR
- lib/IR
- unittests/IR
7 files changed
+913
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
248 | 260 | | |
249 | 261 | | |
250 | 262 | | |
| |||
281 | 293 | | |
282 | 294 | | |
283 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
284 | 299 | | |
285 | 300 | | |
286 | 301 | | |
| |||
0 commit comments