Modeling subregister aliasing
还没有人认领这个 Issue。
评估
调研方向
首先阅读当前 regalloc2 API 中与 PRegs、物理寄存器类和 clobber 集合相关的内容,然后将其与 LLVM 的 register-units 和 subregister 模型进行比较。完成的标准是确定是否能够表示别名,或记录一种 allocator 外部支持的方法,例如固定 constraints、显式 moves 或拆分 live-range。
由索引模型根据 Issue 内容生成。
描述
I’m experimenting with using regalloc2 for a cranelift backend targeting a old Z80 8-bit CPU with hierarchical registers —
where two small registers can form one larger register, and vice versa:
B + C = BC (16-bit)
D + E = DE (16-bit)
H + L = HL (16-bit)
Here’s the challenge:
Some 16-bit instructions can use either BC or DE.
When BC is used, both B and C become clobbered.
When DE is used, D and E are clobbered instead.
The 8-bit registers are individually addressable, but they also participate in 16-bit operations as pairs.
The problem is that regalloc2 assumes all physical registers in a class are disjoint,
and clobber sets must be fixed before allocation.
That makes it unclear how to express a relationship like “BC aliases both B and C” or “writing BC invalidates B and C.”
LLVM handles this using register units and subregisters, where overlapping registers share “register units”
and the allocator tracks partial definitions and interference on that level.
regalloc2, however, currently has no notion of aliasing or register overlap.
So I’m wondering:
Is there any way to model such subregister aliasing with the current regalloc2 API?
Would it make sense to support aliasing PRegs or register subsets (similar to LLVM’s register units / subregister indices)?
Or is the current expectation that these aliasing relationships be handled entirely outside the allocator,
e.g. by inserting explicit moves, using fixed constraints, or splitting live ranges manually?
- 主要语言
- Rust
- 星标
- 266
- 派生
- 54
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/regalloc2 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
bytecodealliance/regalloc2#265 · 8 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
bytecodealliance/regalloc2#222 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
bytecodealliance/regalloc2#206 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
bytecodealliance/regalloc2#194 · 7 条评论 ·
-
难度 4/5 3-5 天 新手友好度 38/100
bytecodealliance/regalloc2#191 · 3 条评论 ·
查看 bytecodealliance/regalloc2 的全部 Issue
相似的 Issue
-
bug CLI custom-model
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
难度 2/5 1-3 小时 新手友好度 75/100