How_to_implment_PL_in_Antlr4: Instructions file for Codex

AGENTS.md

How_to_implment_PL_in_Antlr4 AGENTS.md is an instructions file for Codex, OpenCode from whtoo/How_to_implment_PL_in_Antlr4. It costs 4,269 tokens per session, scanned A, original, BSD-3-Clause.

Project instructions for adding trusted learning resources about compiler optimisation to an AGENTS.md file. The resources cover loop optimisation, SSA, register allocation, and data-flow analysis.

In plain words
What is it for?
Use it when documenting papers, courses, and LLVM source files that explain loop transformations and SSA, a compiler form where each variable assignment has one defining point.
Why use it?
It gives developers references for understanding and implementing compiler optimisation techniques instead of relying on undocumented guidance.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is whtoo/How_to_implment_PL_in_Antlr4's own configuration. It tells Codex and OpenCode how to work on How_to_implment_PL_in_Antlr4 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything How_to_implment_PL_in_Antlr4 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to whtoo/How_to_implment_PL_in_Antlr4. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/whtoo/How_to_implment_PL_in_Antlr4/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/whtoo/How_to_implment_PL_in_Antlr4

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for How_to_implment_PL_in_Antlr4 AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/whtoo/how_to_implment_pl_in_antlr4/agents-md.svg)](https://agentmods.dev/instructions/whtoo/how_to_implment_pl_in_antlr4/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/whtoo/how_to_implment_pl_in_antlr4/agents-md"><img src="https://agentmods.dev/badge/instructions/whtoo/how_to_implment_pl_in_antlr4/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,269 This file is loaded in full into every session.
When invoked 4,269 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04269 $0.04269
Opus 5 $0.02135 $0.02135
Sonnet 5 $0.00854 $0.00854
Haiku 4.5 $0.00427 $0.00427

Measured 3d ago against content hash 7092d5b713fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

How_to_implment_PL_in_Antlr4 AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md 更新:添加优化参考资源章节

📋 更新概述

在AGENTS.md中添加EP21的优化参考资源章节,包括循环优化、SSA构造和优化、寄存器分配、数据流分析等关键技术点的权威参考资料和实现指南。


🔧 EP21 优化Pass 参考资源

循环优化(Loop Optimizations)

CMU 课程资料

  • 标题: CMU 15-732: SSA and Optimizations
  • 链接: PDF
  • 核心内容: SSA形式转换、循环优化技术、不变代码外提
  • 重要性: SSA优化的理论基础

LLVM 实现

  • 组件: LoopUnrollPass, LoopVectorize
  • 文件位置: llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
  • 链接: GitHub
  • 核心价值: 工业级循环展开实现,可直接参考
  • 参考说明: LLVM的循环展开策略和启发式规则

应用场景

  • 学习LLVM的循环展开实现原理
  • 了解何时适用完全展开 vs 部分展开
  • 参考LLVM的循环不变代码外提实现

🎯 SSA 构造与优化参考资源

学术论文

SSA 基础论文

  • 标题: Efficiently Computing Static Single Assignment Form
  • 作者: Cytron, Ferrante, Rosen, Wegman, Zadeck
  • 年份: 1991
  • 链接: DOI
  • 核心贡献: SSA形式定义的奠基性论文
  • 参考章节: SSA-Construction.md中的"SSA形式概述"和"算法步骤"
  • 重要性: 必读的SSA理论经典文献

SSA 优化论文

  • 标题: Efficiently Computing SSA Form and Its Use in Optimization
  • 作者: Brigham
  • 年份: 2002
  • 链接: DOI
  • 核心贡献: SSA优化机会的系统性分析
  • 参考章节: SSA-Construction.md中的"SSA优化机会"
  • 重要性: 理解SSA优化的实际应用

LLVM 实现指南

LLVM SSAUpdater

  • 标题: SSA Update Manager
  • 链接: GitHub
  • 核心价值: 工业级SSA更新器实现,包含大量注释和示例
  • 参考说明: 如何使用SSAUpdater API进行SSA转换和优化
  • 应用场景: 复杂SSA转换的正确实现、SSA优化后的更新

🎯 寄存器分配参考资源

学术论文

线性扫描算法

  • 标题: Linear Scan Register Allocation
  • 作者: Poletto, Sarkar
  • 年份: 1999
  • 链接: PDF
  • 核心贡献: 快速寄存器分配算法,适合JIT编译器
  • 参考章节: Register-Allocation.md中的"线性扫描算法"和"活跃区间表示"
  • 重要性: 线性扫描算法是EP18R的实现基础,必须深入理解

图着色算法

  • 标题: Register Allocation via Graph Coloring
  • 作者: Chaitin
  • 年份: 1982
  • 链接: PDF
  • 核心贡献: 图着色寄存器分配的经典算法
  • 参考章节: Register-Allocation.md中的"图着色算法"和"子算法对比"
  • 重要性: 图着色算法的理论基础,理解复杂度约束

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 289 lines · 4,269 tokens per session scan A 7092d5b713fa

Subscribe to this mod's changes

How_to_implment_PL_in_Antlr4 AGENTS.md is an instructions file published in the GitHub repository whtoo/How_to_implment_PL_in_Antlr4 (34 stars, last pushed 3mo ago), licensed BSD-3-Clause. It adds 4,269 tokens to every session, about $0.0213 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens