bytecodealliance / bytecodealliance/regalloc2

Conflicting defs and clobbers lead to panic rather than clean error from allocator

未关闭
#222 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
265
派生
53
PR 合并指标
30 天内没有已合并 PR

描述

`regalloc2 v0.12.0`

```text
thread 'main' panicked at /home/maxv/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/regalloc2-0.12.0/src/ion/process.rs:1253:17:
Could not allocate minimal bundle, but the allocation problem should be possible to solve
```

Function which causes a panic:

Debug repr

```text
{
machine_env: MachineEnv {
preferred_regs_by_class: [
[
PReg(hw = 0, class = Int, index = 0),
PReg(hw = 1, class = Int, index = 1),
PReg(hw = 2, class = Int, index = 2),
],
[],
[],
],
non_preferred_regs_by_class: [
[],
[],
[],
],
scratch_by_class: [
None,
None,
None,
],
fixed_stack_slots: [],
}
spillslot_size(Int): 1
spillslot_size(Float): 1
spillslot_size(Vector): 1
multi_spillslot_named_by_last_slot: false
allow_multiple_vreg_defs: false
block0(): # succs:[] preds:[]
inst0: op Def: v0i any
inst1: op Def: v1i fixed(p0i), Use: v0i fixed(p1i), Clobber: p0i, Clobber: p1i, Clobber: p2i
inst2: ret Use: v1i fixed(p0i)
}
```

JSON repr

```json
{
"machine_env": {
"preferred_regs_by_class": [
[
{
"bits": 0
},
{
"bits": 1
},
{
"bits": 2
}
],
[],
[]
],
"non_preferred_regs_by_class": [
[],
[],
[]
],
"scratch_by_class": [
null,
null,
null
],
"fixed_stack_slots": []
},
"entry_block": 0,
"insts": [
{
"op": "Op",
"operands": [
{
"bits": 8388609
}
],
"clobbers": {
"bits": [
0,
0,
0,
0
]
}
},
{
"op": "Op",
"operands": [
{
"bits": 2155872256
},
{
"bits": 2197815297
}
],
"clobbers": {
"bits": [
7,
0,
0,
0
]
}
},
{
"op": "Ret",
"operands": [
{
"bits": 2164260864
}
],
"clobbers": {
"bits": [
0,
0,
0,
0
]
}
}
],
"blocks": [
[
0,
3
]
],
"block_preds": [
[]
],
"block_succs": [
[]
],
"block_params_in": [
[]
],
"block_params_out": [
[]
],
"num_vregs": 2,
"debug_value_labels": [],
"spillslot_size": [
1,
1,
1
],
"multi_spillslot_named_by_last_slot": false,
"allow_multiple_vreg_defs": false
}
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

使用提供的函数或 JSON 表示以及 regalloc2 v0.12.0 重现 panic。从 ion/process.rs:1253 开始,跟踪处理冲突定义和 clobber 的 allocator 路径。完成标准是此输入产生干净的 allocator 错误,而不是 panic。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
compilers
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。