Modeling subregister aliasing
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc API hiện tại của regalloc2 liên quan đến PRegs, các lớp thanh ghi vật lý và các tập clobber, sau đó so sánh với mô hình register-units và subregister của LLVM. Hoàn thành khi xác định được liệu có thể biểu diễn aliasing hay không, hoặc ghi lại một cách tiếp cận được hỗ trợ bên ngoài allocator, chẳng hạn như các constraints cố định, các moves tường minh hoặc việc tách live-range.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Rust
- Star
- 266
- Fork
- 54
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bytecodealliance/regalloc2
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
bytecodealliance/regalloc2#265 · 8 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
bytecodealliance/regalloc2#222 · 4 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
bytecodealliance/regalloc2#206 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
bytecodealliance/regalloc2#194 · 7 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
bytecodealliance/regalloc2#191 · 3 bình luận ·
Tất cả issue của bytecodealliance/regalloc2
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
state:needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
zed-industries/zed#64680 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RustPython/RustPython#8802 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
TheLarkInn/aipm#2390 ·