본문으로 건너뛰기
cccskills
무료GitHub에 공개

llvm

Use when working with LLVM IR as a user: emitting IR from clang, running opt passes, lowering with llc, reading IR, or finding a missed optimization. Not for writing new passes: use llvm-passes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin스타 40(GitHub 40 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(3)

  • SKILL.md5.4 KB
  • agents/openai.yaml207 B
  • references/ir-reference.md2.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

LLVM IR and tooling

Contract

FieldBound contract
TriggerThe user wants to see the IR for a function, run or inspect optimization passes with opt, lower IR to assembly with llc, read an IR construct, or find out why a transform did not fire.
AuthorityRead-only. Commands write .ll, .bc, .s, and .o files only into a scratch location the user names; the project tree is not modified. Rollback is deleting the scratch outputs. No remote mutation.
Side effectScratch IR and object files; chat output.
DoneThe requested IR, pass output, or lowering exists in the scratch location, and each construct or remark the user asked about has a one-line reading.

Inputs

  • LLVM version: required, from opt --version. Current stable is LLVM 23.1.0; pass names below are new-pass-manager names and apply to any line since 14.
  • Source file or existing .ll/.bc file: required.
  • Target CPU and features when lowering: optional; defaults to the host.
  • The question: required. One of emit, transform, lower, read, or diagnose.

Procedure

  1. Emit IR. Textual: clang -O0 -emit-llvm -S src.c -o src.ll. Bitcode: clang -O2 -emit-llvm -c src.c -o src.bc. Convert: llvm-dis src.bc -o src.ll, llvm-as src.ll -o src.bc. Emit at -O0 when the goal is to read the front end's output, at -O2 when the goal is to read what the optimizer produced. Done when: the .ll file exists.

  2. Run passes with opt. Named passes: opt -passes='mem2reg,instcombine,simplifycfg' src.ll -S -o out.ll. Standard pipelines: opt -passes='default<O2>' src.ll -S -o out.ll. List available passes: opt --print-passes. Show the full pipeline clang builds: clang -O2 -mllvm -print-pipeline-passes -c src.c -o /dev/null. Dump IR after every pass: opt -passes='default<O2>' -print-after-all src.ll -S 2>&1, which is verbose; redirect it to a file. Done when: the transformed IR exists and the pass list is stated.

  3. Lower with llc. Object: llc -filetype=obj src.ll -o src.o. Assembly: llc -filetype=asm src.ll -o src.s; Intel syntax on x86 is --x86-asm-syntax=intel. CPU and features: llc -mcpu=skylake -mattr=+avx2 src.ll -o src.s. Registered targets: llc --version. Done when: the assembly or object exists.

  4. Read the IR using the construct table; expand any construct the user names from the reference. Done when: each construct in the question has a reading.

    ConstructMeaning
    allocaStack slot; mem2reg promotes it to SSA values
    load, storeMemory access through an opaque ptr
    getelementptrAddress arithmetic for fields and elements
    phiSSA merge of values from predecessor blocks
    call, invokeCall; invoke carries exception edges
    icmp, fcmpInteger and float comparison
    br, switch, retControl flow and return
    trunc, zext, sext, bitcastWidth and representation changes
    ptrtoint, inttoptrPointer and integer conversion; avoid where possible
  5. Name the pass that owns a transform from the table when the user asks why something did or did not happen. Done when: the pass is named.

    PassEffect
    mem2reg, sroaPromote allocas and split aggregates into SSA values
    instcombinePeephole instruction combining
    simplifycfgControl-flow cleanup, dead-block removal
    gvn, early-cseRedundancy elimination
    licmLoop-invariant code motion
    loop-unrollLoop unrolling
    loop-vectorize, slp-vectorizeLoop and straight-line vectorization
    inlineFunction inlining
    argpromotionPointer arguments to values
    tailcallelim, reassociate, dceTail calls, reassociation, dead code
  6. Diagnose a missed transform from source with remarks: clang -O2 -Rpass-missed=loop-vectorize -Rpass-analysis=loop-vectorize src.c. When the answer needs IR before and after one pass, use opt -passes='<pass>' -print-before=<pass> -print-after=<pass> on the .ll file. Done when: the analysis remark or the IR diff names the blocker.

  7. Point to the companion tools by task: llvm-link joins bitcode files, llvm-lto runs standalone LTO, llvm-nm and llvm-objdump inspect objects, llvm-profdata merges profiles, llvm-cov reports coverage, llvm-mca estimates throughput and latency of an assembly block. GNU equivalents: use binutils. Done when: the tool for the follow-up task is named.

Failure and recovery

Failure classBehavior
Pass name unknown to optRun opt --print-passes and pick the matching name; legacy -passname spellings are not accepted by the new pass manager.
llc rejects a flagRun llc --help-hidden for the target-specific spelling; -masm-syntax=intel is not a flag, --x86-asm-syntax=intel is.
Front-end question rather than IR questionLexer, parser, and IR generation from an AST: use compiler-frontend.
Runtime code generationORC JIT and in-memory execution: use jit-compilation.
New pass wantedWriting and testing a PassPlugin: use llvm-passes.

Output

The scratch files produced (.ll, .bc, .s, .o) with the exact commands that made them, plus a chat reading of each construct, pass, or remark the user asked about.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

af-xdp

무료

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

agents-md

무료

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin402026년 9월 29일 업데이트

OutlineDriven의 스킬 모두 보기

이 스킬의 문제 신고