mlir-development

Develop custom MLIR dialects, operations, and transformation passes for compilers.

434|96|Updated Aug 9, 2023
One-click install
npx skills add https://github.com/backengineering/llvm-msvc --skill mlir-development-backengineering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mlir-development
Source: https://github.com/backengineering/llvm-msvc/tree/main/.agents/skills/mlir-development
Command: npx skills add https://github.com/backengineering/llvm-msvc --skill mlir-development-backengineering

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building domain-specific compilers and advanced optimization pipelines by providing expertise in MLIR (Multi-Level Intermediate Representation) and CIR (Clang IR).

Core Features & Use Cases

  • MLIR Infrastructure: Develop custom dialects, operations, and types within the MLIR framework.
  • Compiler Pass Development: Write and apply transformation and analysis passes for high-level optimizations.
  • Dialect Conversion: Implement lowering strategies between different MLIR dialects (e.g., custom to LLVM, TensorFlow to Linalg).
  • CIR Integration: Leverage CIR for C/C++ representation in MLIR for better tooling and optimization.
  • Use Case: You are developing a new hardware accelerator and need to define a custom intermediate representation for it. This Skill can help you define the necessary MLIR dialects and transformations to lower your high-level code to your target.

Quick Start

Use the mlir-development skill to create a new MLIR dialect with custom add and multiply operations.

Frequently Asked Questions about mlir-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a custom MLIR dialect for a hardware accelerator?

Defining custom MLIR dialects involves creating specific operations and types within the MLIR infrastructure to represent your hardware accelerator's unique instruction set and memory hierarchy.

How does progressive lowering work when converting custom dialects to LLVM?

Progressive lowering systematically converts high-level MLIR dialects into lower-level representations, enabling step-by-step translation from custom operations to standard LLVM dialects for final compilation.

Can I use CIR for C and C++ representation in MLIR?

Yes, CIR (Clang IR) provides a representation for C and C++ code within the MLIR framework, enabling enhanced tooling and optimization capabilities for C/C++ compilation pipelines.

How do I write transformation passes for MLIR optimization pipelines?

Writing MLIR transformation passes involves implementing analysis and conversion logic that manipulates operations within your custom dialects to achieve high-level compiler optimizations across the compilation pipeline.

What is the best way to integrate a domain-specific language into an existing compiler infrastructure?

Integrating a domain-specific language is best achieved by defining custom MLIR dialects and implementing progressive lowering strategies to seamlessly connect with existing compiler infrastructures like LLVM.

Do I need MLIR to build a domain-specific compiler from scratch?

Using MLIR for domain-specific compilers simplifies defining custom intermediate representations and optimization passes, making it highly effective for targeting custom hardware accelerators and advanced pipelines.