Cranelift: inliner remaps dynamic types with the dynamic-stack-slot offset
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 cranelift/codegen/src/inline.rs 中的 create_dynamic_types 开始,这里的偏移量是从 func.dynamic_stack_slots.len() 而不是 func.dfg.dynamic_types.len() 推导出来的;阅读内联槽位与动态类型是如何配对的,以确认正确的索引。通过 clif-util test(cargo run -p clif-util)复现 .clif 用例。当 ; check: 行匹配且 Context::compile 不再因 Undeclared dynamic vector type 而 panic 时即为完成;cranelift/filetests 下的 filetests 覆盖 test inline。
由索引模型根据 Issue 内容生成。
描述
create_dynamic_types in cranelift/codegen/src/inline.rs computes its
offset from func.dynamic_stack_slots.len(), but it should use
func.dfg.dynamic_types.len(). Whenever the caller has a different number
of dynamic stack slots than dynamic types, inlined slots name the wrong
dynamic type. The verifier accepts the result, and then:
Context::compilepanics withUndeclared dynamic vector type, if the
index is out of range; or- the inlined slot silently gets one of the caller's unrelated types.
.clif Test Case
test inline
target aarch64
function %callee(i32) {
gv0 = dyn_scale_target_const.i32x4
dt0 = i32x4*gv0
dss0 = explicit_dynamic_slot dt0
block0(v0: i32):
v1 = splat.dt0 v0
v2 = dynamic_stack_addr.i64 dss0
store.dt0 notrap aligned v1, v2
return
}
function %caller() {
gv0 = dyn_scale_target_const.i64x2
dt0 = i64x2*gv0
dss0 = explicit_dynamic_slot dt0
dss1 = explicit_dynamic_slot dt0
fn0 = %callee(i32)
block0:
v0 = iconst.i32 1
call fn0(v0)
return
}
; check: dss2 = explicit_dynamic_slot dt1
Steps to Reproduce
clif-util test test.clif
Expected Results
The inlined slot uses the copied callee type:
dss2 = explicit_dynamic_slot dt1.
Actual Results
Missed #0: \bdss2 = explicit_dynamic_slot dt1\b
> dss2 = explicit_dynamic_slot dt2
The caller has no dt2. Compiling the inlined function panics with
Undeclared dynamic vector type: dt2.
Versions and Environment
Cranelift version or commit: 73b04cff33
Operating system: macOS 15.8.1
Architecture: aarch64
- 主要语言
- Rust
- 星标
- 18.7k
- 派生
- 1.9k
- 平均合并
- 22 小时 23 分钟
- 30 天内合并 PR
- 311
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/wasmtime 的其他 Issue
-
bug wasm-proposal:exceptions wasmtime:debugging
难度 2/5 1-3 小时 新手友好度 76/100
bytecodealliance/wasmtime#14102 ·
维护者通常 1 天内回复
-
wasm-proposal:gc
难度 2/5 1-3 小时 新手友好度 62/100
bytecodealliance/wasmtime#13808 · 2 条评论 ·
维护者通常 1 天内回复
-
cranelift cranelift:area:clif cranelift:goal:optimize-speed enhancement
难度 2/5 1-3 小时 新手友好度 78/100
bytecodealliance/wasmtime#1598 · 9 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 8/100
bytecodealliance/wasmtime#14769 ·
维护者通常 1 天内回复
-
cranelift cranelift:goal:optimize-speed
难度 4/5 3-5 天 新手友好度 35/100
bytecodealliance/wasmtime#14699 ·
维护者通常 1 天内回复
查看 bytecodealliance/wasmtime 的全部 Issue
相似的 Issue
-
agent:triaged bug bughunt pm:pipenv priority:p1
难度 2/5 1-3 小时 新手友好度 78/100
SocketDev/socket-patch#1608 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
adorsys/status-list-server#698 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
nannou-org/egui_graph#92 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
Deduplicate normalized_f64_bits (hash_table.rs and bloom_filter.rs)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
tursodatabase/turso#10002 ·
维护者通常 1 天内回复