Rematerialization
还没有人认领这个 Issue。
评估
调研方向
首先追踪 issue 中描述的 Function trait 和 Edit enum,以及现有的 VReg、PReg、spill 和 reload 处理。确定是否可以在不支持复杂 rematerialization 的情况下设计简单常量 rematerialization 的范围;完成内容应包括元数据接口、rematerialization 编辑,以及对 spill 和 reload 行为的覆盖。
由索引模型根据 Issue 内容生成。
描述
As an alternative to spilling and reloading, a vreg value can sometimes be recomputed from other available values. There are two ways this can be supported in regalloc2:
Simple rematerialization
Supporting rematerialization for constants, including runtime constants which only depend on pinned registers (e.g. VMContext), is relatively straightforward. The client needs to track rematerialization metadata for each VReg, after which we can elide spills for this vreg (unless there is a stack use) and replace reloads with rematerializations.
trait Function {
fn can_rematerialize(&self, vreg: VReg) -> bool;
}
enum Edit {
/// The code sequence for rematerialization is only allowed to
/// use `dest` and the dedicated scratch register.
Rematerialize {
vreg: VReg,
// This is not an Allocation because rematerializing
// into a stack slot doesn't make sense.
dest: PReg,
}
}
Complex rematerialization
Rematerialization involving values in other vregs is more complex and probably not worth the effort of implementing. It has been done before as part of a research project on V8 but AFAIK this has not made it into the main V8 codebase.
- 主要语言
- 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 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
bytecodealliance/regalloc2#247 · 3 条评论 ·
-
难度 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 条评论 ·
查看 bytecodealliance/regalloc2 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
state:needs triage
难度 2/5 1-3 小时 新手友好度 70/100
zed-industries/zed#64680 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 70/100
RustPython/RustPython#8802 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2390 ·