mlir-dialect-designer
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Designs MLIR dialects and transformations. Use when: (1) Building domain-specific
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- axiomatic-semanticsSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- control-flow-analysisSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-handlers-implementerSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- llvm-backend-generatorSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- model-checkerSkill
- module-systemSkill
- monad-transformerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Use traits for common operation properties
- Distinctive: line 64
Follow ODS (Operation Definition Specification)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MLIR Dialect Designer
Designs MLIR (Multi-Level Intermediate Representation) dialects and transformations.
When to Use
- Building domain-specific compilers
- Creating custom IR abstractions
- Implementing multi-level lowering
- Optimizing compilers for specific domains
- Integrating with LLVM ecosystem
What This Skill Does
- Designs dialects - Custom operations and types
- Defines patterns - Transformation rules
- Implements lowering - Dialect-to-dialect lowering
- Creates passes - Optimization and lowering passes
Key Concepts
| Concept | Description |
| Dialect | Collection of operations and types |
| Operation | Instructions in the IR |
| Block | Sequence of operations |
| Region | Container for blocks |
| Pattern | Transformation rule |
Standard Dialects
| Dialect | Purpose |
| arith | Arithmetic operations |
| linalg | Linear algebra |
| affine | Affine loops/conditionals |
| scf | Structured control flow |
| func | Function definitions |
| LLVM | LLVM dialect |
Tips
- Design operations at right abstraction level
- Use traits for common operation properties
- Implement folding for constant propagation
- Follow ODS (Operation Definition Specification)
- Test patterns thoroughly
Related Skills
llvm-backend-generator- LLVM code generationssa-constructor- SSA formdataflow-analysis-framework- Analysisllvm-backend-generator- Integration
Canonical References
| Reference | Why It Matters |
| MLIR Specification | Official MLIR docs |
| TensorFlow MLIR | Production MLIR usage |
| LLVM Developers Meeting Talks | MLIR design talks |
| ODSv2 Tutorial | Operation definition |
Tradeoffs and Limitations
Design Tradeoffs
| Approach | Pros | Cons |
| High-level ops | Simple, easy to optimize | Less control |
| Low-level ops | Fine-grained control | Complex patterns |
| Hybrid | Balance | Complexity |
Limitations
- Steep learning curve
- Large ecosystem to understand
- Patterns can be complex
- Dialect conversion requires care
Research Tools & Artifacts
Real-world MLIR dialects:
| Tool | Why It Matters |
| Linalg | Linear algebra dialect |
| SCF | Control flow dialect |
| Affine | Affine loops dialect |
| Vector | Vector operations |
Key Systems
- TensorFlow MLIR: Production MLIR
- IREE: MLIR-based runtime
Research Frontiers
Current MLIR research:
| Direction | Key Papers | Challenge |
| Dialect design | "MLIR Design" | Abstractions |
| Lowering | "Dialect Lowering" | Patterns |
Hot Topics
- Wasm MLIR: WebAssembly dialect
- Quantum MLIR: Quantum dialects
Implementation Pitfalls
Common MLIR bugs:
| Pitfall | Real Example | Prevention |
| Patterns | Wrong pattern | Test |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

