AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Llvm Ir And Passes

skill-mohitmishra786-low-level-dev-skills-llvm-ir-and-passes · by mohitmishra786

LLVM IR and passes skill for reading compiler IR. Use when analyzing LLVM IR, understanding SSA, pass pipeline order, or running opt on bitcode. Activates on queries about LLVM IR, SSA form, opt passes, llvm-dis, pass pipeline, or reading .ll files.

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-mohitmishra786-low-level-dev-skills-llvm-ir-and-passes

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-mohitmishra786-low-level-dev-skills-llvm-ir-and-passes)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Llvm Ir And Passes? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

LLVM IR and Passes

Purpose

Teach agents to read and reason about LLVM IR (SSA, types, terminators), navigate the standard pass pipeline, and use opt/llvm-dis for inspection. Complements skills/compilers/llvm (toolchain) and skills/compiler-internals/llvm-passes (writing plugins) — not merged.

When to Use

  • Understanding what -O2 changed in generated IR
  • Triaging miscompiles between Clang versions
  • Preparing to write a custom pass
  • Teaching SSA and dominance without writing C++ passes yet

Workflow

1. LLVM IR structure

; Function in SSA form
define i32 @add(i32 %a, i32 %b) {
entry:
  %sum = add i32 %a, %b
  ret i32 %sum
}

Key concepts: basic blocks, PHI nodes at merges, typed values (i32, ptr, vectors).

2. Emit IR from Clang

clang -S -emit-llvm -O0 -o foo.ll foo.c
clang -c -emit-llvm -O2 -o foo.bc foo.c
llvm-dis foo.bc -o foo.ll

3. Standard optimization pipeline (New PM)

Clang -O2 roughly runs:

SimplifyCFG → InstCombine → GVN → LICM → LoopVectorize → ...

Inspect with:

opt -passes='default' -S foo.ll -o foo-opt.ll
opt -passes='default' -print-passes foo.ll 2>&1 | head

4. Useful analysis passes

| Pass | Shows | |------|-------| | -passes=print | Dominator tree | | -passes=print | Loop nests | | -passes=print-alias-sets | Alias sets |

opt -passes='print' -disable-output foo.ll

5. Reading PHI and UB

merge:
  %v = phi i32 [ %a, %then ], [ %b, %else ]

undef and poison in IR model LLVM poison semantics — distinct from C UB but related.

6. Compare before/after

opt -passes='instcombine,simplifycfg' -S foo.ll -o - | diff -u foo.ll -

7. Agent usage

/llvm-ir-and-passes Explain this PHI node and which pass likely created it

Common Problems

| Symptom | Cause | Fix | |---------|-------|-----| | Pass not found | LLVM version rename | opt --print-passes for your build | | IR mismatch | Different LLVM major | Match clang/opt versions | | "optnone" blocks opts | -O0 attribute | Compile with -O1+ | | Huge IR | Inlined headers | -fno-discard-value-names off; filter function | | Wrong pipeline | Legacy vs NPM | Use -passes= syntax |

Related Skills

  • skills/compilers/llvm — toolchain overview
  • skills/compiler-internals/llvm-passes — writing PassPlugins
  • skills/compiler-internals/compiler-optimizations-deep — RA and ISel
  • skills/compiler-internals/compiler-frontend — IR generation
  • skills/rust/rustc-basicsrustc --emit=llvm-ir

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.