Open bjorn3 opened 4 years ago
This issue or pull request has been labeled: "cranelift"
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json
configuration file.
I started working on this at https://github.com/bjorn3/wasmtime/tree/value_debuginfo_fixes, but I am stuck ATM. Associated cg_clif branch: https://github.com/bjorn3/rustc_codegen_cranelift/tree/wip_debuginfo_improvements (bjorn3/rustc_codegen_cranelift@12b6e83a489180ff52a9376c6674202c6cd1ecda). In the following case val0
, val1
, val2
, val3
, val4
and val5
should get one or more ValueLocRange
's. However only val2
and val4
get one.
[
LiveRange { value: v0, affinity: Reg(RegClassIndex(0)), def_begin: ProgramPoint(block0), def_end: ProgramPoint(inst1), liveind: [Interval { begin: block1, end: inst6 }] },
LiveRange { value: v2, affinity: Reg(RegClassIndex(0)), def_begin: ProgramPoint(inst3), def_end: ProgramPoint(inst4), liveind: [] },
LiveRange { value: v3, affinity: Reg(RegClassIndex(4)), def_begin: ProgramPoint(inst4), def_end: ProgramPoint(inst5), liveind: [] },
LiveRange { value: v4, affinity: Reg(RegClassIndex(0)), def_begin: ProgramPoint(inst5), def_end: ProgramPoint(inst7), liveind: [] },
]
It seems that v1
doesn't have liveness information despite the ghost_use.i64 v1
.
It assumes SourceLoc is strictly ascending. (Checking for last_srcloc.unwrap() > srcloc instead of last_srcloc.unwrap() != srcloc)
This property might be essential track ranges transformation (e.g. during DWARF translation). Though it is possible to expose that indirectly via some context.
ValueLabel
introduced at eachSourceLoc
. (build_value_labels_index
)SourceLoc
is strictly ascending. (Checking forlast_srcloc.unwrap() > srcloc
instead oflast_srcloc.unwrap() != srcloc
)ValueLabel
is only alive for a continuous range ofSourceLoc
. (values_labels.range(range)
)All of those assumptions are broken by cg_clif, meaning that
build_value_labels_ranges
often misses values in the output.