llvm-optimization

Develop and tune LLVM optimization passes for IR-to-machine-code workflows.

69|11|Updated May 16, 2026
One-click install
npx skills add https://github.com/NeverSight/NeverC --skill llvm-optimization-neversight
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llvm-optimization
Source: https://github.com/NeverSight/NeverC/tree/main/.agents/skills/llvm-optimization
Command: npx skills add https://github.com/NeverSight/NeverC --skill llvm-optimization-neversight

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you design and apply LLVM optimizations without degrading correctness or performance, so you can reliably improve generated code quality in your compiler pipeline.

Core Features & Use Cases

  • Optimization pass development: Create custom LLVM passes using the modern Pass Manager to transform IR and guide analyses.
  • Performance tuning & pass selection: Understand and choose optimization levels and common pipeline stages for scalar, loop, and interprocedural improvements.
  • Correctness-aware debugging: Inspect pass execution and validate transformations using tooling like Alive2 to catch incorrect rewrites.

Quick Start

Use the llvm-optimization skill to implement and debug a custom optimization pass by running LLVM IR through a targeted pass and verifying transformation correctness with Alive2.

Frequently Asked Questions about llvm-optimization

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

FAQPage Schema
How do I develop a custom LLVM optimization pass using the modern Pass Manager?

To develop a custom LLVM pass, use the modern Pass Manager to transform IR and guide analyses for scalar, loop, or interprocedural improvements. This approach allows you to reliably insert targeted transformations into your compiler pipeline.

How can I verify the correctness of an LLVM IR transformation?

Verify LLVM IR transformation correctness by using Alive2 to validate pass rewrites and catch incorrect transformations. This correctness-aware debugging ensures your optimizations do not degrade program behavior during the IR-to-machine-code workflow.

How do I choose LLVM optimization levels and pipeline stages for performance tuning?

Choose LLVM optimization levels and pipeline stages by evaluating the requirements for scalar, loop, and interprocedural improvements like inlining, LICM, and vectorization. Selecting the right pipeline stages ensures you effectively improve generated code quality.

Can I use this for loop vectorization and dead-code removal in my compiler toolchain?

Yes, you can apply this to loop vectorization and dead-code removal tasks within your compiler toolchain. It supports scalar, loop, and interprocedural optimization workflows to improve generated program performance across IR transformations.

What is the best way to debug LLVM pass execution and inspect performance?

The best way to debug LLVM pass execution is through pass debugging and profiling workflows that inspect execution and validate transformations. This process helps identify performance degradation or incorrect rewrites during pipeline tuning.

Why does my LLVM optimization pass produce incorrect rewrites?

LLVM optimization passes produce incorrect rewrites when transformations are not validated for correctness. Inspect pass execution and use Alive2 to verify that your IR transformations maintain program semantics and catch invalid rewrites.