<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Richard Qin — Notes Updates</title>
    <link>https://richardqin.org/notes/</link>
    <description>New and substantially revised technical notes by Richard Qin.</description>
    <atom:link href="https://richardqin.org/notes/rss.xml" rel="self" type="application/rss+xml" />
    <lastBuildDate>Fri, 16 Oct 2026 00:00:00 &#43;0800</lastBuildDate><item>
      <title>CVS 版本控制系统简介与基本使用</title>
      <link>https://richardqin.org/notes/cvs-introduction.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/cvs-introduction.html#updated-2026-10-16</guid>
      <pubDate>Fri, 16 Oct 2026 00:00:00 &#43;0800</pubDate>
      <description>介绍 CVS 的集中式版本控制模型、仓库初始化、项目导入、检出与提交，以及其特点和局限。</description>
    </item><item>
      <title>Linux 内核 chroot 的工作原理及使用 Debian GNU/Linux Live CD 修复 GRUB</title>
      <link>https://richardqin.org/notes/linux-and-operating-systems/chroot-principles-and-grub-recovery.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/linux-and-operating-systems/chroot-principles-and-grub-recovery.html#updated-2026-10-15</guid>
      <pubDate>Thu, 15 Oct 2026 00:00:00 &#43;0800</pubDate>
      <description>从 Linux VFS 和进程文件系统上下文理解 chroot，并通过 Debian Live 环境修复 UEFI 与 BIOS 模式下的 GRUB。</description>
    </item><item>
      <title>狭义相对论调研报告</title>
      <link>https://richardqin.org/notes/physics/special-relativity.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/physics/special-relativity.html#updated-2026-09-18</guid>
      <pubDate>Fri, 18 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>一份关于狭义相对论的调研报告。</description>
    </item><item>
      <title>从 xv6 的初始化到 Linux 的 init_task</title>
      <link>https://richardqin.org/notes/linux-and-operating-systems/from-xv6-init-to-linux-init-task.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/linux-and-operating-systems/from-xv6-init-to-linux-init-task.html#updated-2026-09-14</guid>
      <pubDate>Mon, 14 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>操作系统启动通常从一段受严格控制的执行环境开始。处理器完成体系结构相关的早期准备以后进入内核，内核随后建立内存管理、异常处理、调度器、文件系统以及设备管理等基础设施。对于 xv6 这样的教学操作系统，这一过程具有很清楚的线性结构。初始化函数按照依赖关系排列，内核逐步把各个子系统建立起来，随后创建第一个用户进程并进入调度循环。
Linux 的初始化过程保留了同样的基本依赖关系，只是系统规模扩大以后， …</description>
    </item><item>
      <title>寄存器分配 — 第七部分: SSA 与寄存器分配</title>
      <link>https://richardqin.org/notes/register-allocation/ssa.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/ssa.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>前面几部分讨论寄存器分配时, 我们一直从一般的 live range 出发. 一个机器级虚拟寄存器可能经历多次 definition, allocator 再通过 liveness 判断某一个 definition 产生的值在什么区域有效. SSA, 即 Static Single Assignment, 把这个关系整理得更规整: 每个 SSA value 只有一个 definition, 每个 …</description>
    </item><item>
      <title>寄存器分配 — 前言</title>
      <link>https://richardqin.org/notes/register-allocation/preface.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/preface.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>最近一直在进行的工作就是推进我的新编译器, 虽然在现在这个时代一个人实现一个功能完备性能又很好的大型软件几乎不可能, 但是我目前至少在让后端尽可能支持更多的功能以及对代码有更好的优化. 完整的代码暂时没有公开, 但是欢迎各位去看我的生成代码质量比较好的竞赛编译器: rcc-project 说到后端, 寄存器分配无疑是最重要的环节之一, 但是翻了一下知乎, 没有发现系统地讲解寄存器分配的文章, 而且 …</description>
    </item><item>
      <title>寄存器分配 — 第九部分: CPU 工业寄存器分配: LLVM 与 GCC</title>
      <link>https://richardqin.org/notes/register-allocation/llvm-gcc.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/llvm-gcc.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>前八部分建立的各种概念在 LLVM 和 GCC 中都有对应物, 但它们寄存器分配策略大相径庭. LLVM 的优化型 allocator 长期围绕 LiveInterval 工作, 保留 value 在机器代码位置上的生命周期信息, 然后针对某个 physical register 查询实际 interference. 当 assignment 失败时, Greedy 可以 eviction, …</description>
    </item><item>
      <title>寄存器分配 — 第二部分: 活跃性分析与生命周期</title>
      <link>https://richardqin.org/notes/register-allocation/liveness.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/liveness.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>寄存器分配面对的是一种随程序位置变化的资源需求. 一个函数里可能出现几百个 virtual registers, 但 allocator 并不需要同时为它们全部准备物理寄存器. 某个 value 在完成最后一次有意义的 use 之后, 保存它的寄存器就可以重新利用. 因此, 在开始讨论 interference graph 或 Linear Scan 之前, 首先需要确定每个 value 在程序的 …</description>
    </item><item>
      <title>寄存器分配 — 第六部分: Linear Scan Register Allocation</title>
      <link>https://richardqin.org/notes/register-allocation/linear-scan.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/linear-scan.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>前面两部分一直沿着 interference graph 展开. Graph coloring 把 liveness 压缩成 &amp;ldquo;哪些 live ranges 互相冲突&amp;rdquo;, 然后在这张图上寻找颜色. Linear Scan 选择保留另一种信息: 每个值在程序的哪些位置 live. 它先把机器指令排列在线性的 position space 中, 再把每个 value 的生命周期 …</description>
    </item><item>
      <title>寄存器分配 — 第三部分: Interference Graph 与冲突模型</title>
      <link>https://richardqin.org/notes/register-allocation/interference-graph.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/interference-graph.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>上一部分已经解决了 liveness 问题. 对任意一个程序位置, 我们可以判断哪些值仍然需要保留, 也可以进一步构造 live range 或 live interval. 寄存器分配接下来需要把这些位置相关的信息转化成寄存器之间的约束. 对经典 graph coloring allocator 来说, 这个约束通常通过 Interference Graph 表示.
1 从 liveness 到 …</description>
    </item><item>
      <title>寄存器分配 — 第四部分: 经典 Graph Coloring Register Allocation</title>
      <link>https://richardqin.org/notes/register-allocation/graph-coloring.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/graph-coloring.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>上一部分已经把寄存器分配抽象成了图着色问题. 给定 interference graph G=(V,E)G=(V,E) 和 KK 个可用物理寄存器, allocator 希望给每个节点分配一种颜色, 并保证相邻节点颜色不同. 真正困难的地方在于, 一般图的 KK-coloring 很难直接求解, 而编译器还需要同时决定哪些值值得 spill, spill 之后怎样改写程序, 以及如何在有限编译时间 …</description>
    </item><item>
      <title>寄存器分配 — 第十部分: GPU 寄存器分配与 Occupancy</title>
      <link>https://richardqin.org/notes/register-allocation/gpu-occupancy.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/gpu-occupancy.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>CPU 和 GPU 都需要把数量近乎无限的 virtual registers 映射到有限的 physical registers, 因而 liveness, interference, splitting, spilling 和 coalescing 这些基本问题并没有因为执行设备变成 GPU 而消失. 真正发生变化的是寄存器资源参与性能的方式. 由于 GCC 在 GPU 上已经落后很多了, 所 …</description>
    </item><item>
      <title>寄存器分配 — 第一部分：寄存器分配问题与基本模型</title>
      <link>https://richardqin.org/notes/register-allocation/fundamentals.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/fundamentals.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>1. 从虚拟寄存器到物理寄存器 编译器进入后端以后, 会逐渐把源语言里的表达式, 变量和控制流降低成越来越接近目标机器的形式. 到了指令选择之后, 程序通常已经表现为机器指令或者准机器指令, 但这些指令里使用的寄存器仍然常常是虚拟寄存器.
例如, 一个中间结果可能被表示成:
%v1 = ADD %v2, %v3 %v4 = MUL %v1, %v5 %v6 = SUB %v4, %v1 这里的 …</description>
    </item><item>
      <title>寄存器分配 — 第八部分: 真实 CPU 体系结构约束</title>
      <link>https://richardqin.org/notes/register-allocation/cpu-constraints.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/cpu-constraints.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>前面的 graph coloring 和 Linear Scan 都从一个相对理想化的模型出发. 假设机器有 KK 个物理寄存器, 每个 virtual register 都可以从这 KK 个寄存器中任选一个, 相邻 live ranges 只需要保证颜色不同. 这个模型足以解释 interference, spilling, coalescing 和 splitting 的基本原理, 但真实 …</description>
    </item><item>
      <title>寄存器分配 — 第五部分: Coalescing 与 Iterated Register Coalescing</title>
      <link>https://richardqin.org/notes/register-allocation/coalescing.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/coalescing.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>第四部分暂时把 interference graph 当成了一张只包含硬约束的图: 两个节点之间有边, 就必须分配不同颜色. 真实机器 IR 中还大量存在另一类关系, 即 COPY 或 move. 对于一条 b = COPY a, allocator 希望 aa 和 bb 最终获得同一个物理寄存器, 这样 COPY 就可以消失. 这使寄存器分配同时面对两种方向相反的约束: interference …</description>
    </item><item>
      <title>寄存器分配 — 第十一部分: 高级问题与协同优化</title>
      <link>https://richardqin.org/notes/register-allocation/advanced-topics.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/register-allocation/advanced-topics.html#updated-2026-09-09</guid>
      <pubDate>Wed, 09 Sep 2026 00:00:00 &#43;0800</pubDate>
      <description>前面的章节已经把 register allocation 的主要机制拆开讨论过. Liveness 决定 value 在什么位置必须存在, interference 或 live interval 描述这些生命周期怎样竞争物理资源, allocator 再通过 coloring, priority assignment, eviction, splitting 和 spilling 完成实际分配. …</description>
    </item><item>
      <title>Reading RSS with Standard Tools</title>
      <link>https://richardqin.org/notes/rss.html</link>
      <guid isPermaLink="false">https://richardqin.org/notes/rss.html#updated-2026-08-06</guid>
      <pubDate>Thu, 06 Aug 2026 00:00:00 &#43;0800</pubDate>
      <description>A short standalone note about inspecting RSS feeds.</description>
    </item>
  </channel>
</rss>
