Refactor ImproveMemoryOps around shared, read-only address analysis
Maintainer thường phản hồi trong vòng 1 ngày
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
Start by locating ImproveMemoryOps and GatherCoalescePass, then read the existing gather/scatter baseline tests and benchmarks mentioned in the issue. The first PR is to add a read-only access decoder and base/offset analysis that feeds existing emission. It is done when assembly and diagnostics remain unchanged; the issue does not name specific source or test file paths.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ImproveMemoryOps mixes address recognition, legality checks, target decisions, and IR construction. Some matchers create instructions before matching succeeds, and address analysis overlaps with GatherCoalescePass. Width, extension, and overflow assumptions are spread across several helpers, making changes difficult to audit.
The goal is an incremental refactoring that preserves existing performance and correctness, then enables targeted improvements using the gather/scatter baseline tests and benchmarks already prepared.
Proposed plan
-
Introduce a shared, read-only access description.
Describe the original operation, uniform base or general varying pointers, offsets, arithmetic widths, extension operations, scale, displacement, lane pattern, mask, alignment, address space, and source location. Start with existing pseudo-call forms, including the prefetch paths handled by this pass. Failed matching must leave IR unchanged; unknown cases retain a valid fallback. -
Separate analysis, legality, selection, and emission.
Initially feed the new analysis into existing emitters and retain current target choices. Migrate base/offset recovery, constant factoring, recovery of additional constants after intervening passes, broadcast, forward/reverse linear access, and known-mask simplification in small changes. Preserve repeated optimization when a replacement exposes another opportunity. -
Make address-equivalence and footprint checks explicit.
Audit narrowing, arithmetic across extensions, and overflow-flag propagation. Choosing a 32-bit gather index must preserve the effective address, including hardware scale and displacement. Broadcast and wider-load transformations must preserve inactive-lane fault behavior. Store transformations must preserve active-lane values and overlap semantics. -
Deliver width and scale improvements separately from structural changes.
Recognizeshlas well asmul, handle scale plus field displacement, and use range/known-bit information for narrow unsigned indices. Allow 32-bit hardware indices under either addressing mode when proven equivalent; otherwise retain 64-bit indices. Initial targets are #1256, #1531, and #1581. -
Integrate with post-inline cleanup and late lowering.
Coordinate with #3808 so address information survives the final application inliner. Carry the original index and extension explicitly when later IR analysis cannot recover them reliably. Account for builtin lifetime, expansion after lowering, subsequent cleanup, and warning locations. Validate normal and deferred-inlining configurations independently. -
Reuse the analysis for local patterns and grouped coalescing.
Extend exact-footprint repeated-address and permutation cases, then migrateGatherCoalescePass. Follow-on changes can support non-factored gathers on hardware-gather targets, more element types, equivalent address expressions, and alias-aware grouping. This provides the path toward #304/#330 and related layout cases.
Related work and boundaries
- Land #3984/#3985 correctness fixes separately before dependent transformations.
- Split #3983 into independent attribute fixes and representation/pipeline work.
- Keep aggregate-copy packing, adjacent scalar-store combining, and masked-byte-store improvements as follow-on changes for #2778, #2720, #2943, #2308, and #2901/#2899.
- Broad LLVM-intrinsic replacement and a full target cost model can follow once the analysis and migration are validated.
Validation and acceptance
- Structural changes preserve normalized assembly and diagnostics.
- Optimization changes document intended differences and update the corresponding issue-test expectations.
- Exercise guard pages, all-off/sparse/tail masks, signed and unsigned indices, overflow boundaries, aliasing, duplicate scatter addresses, both addressing modes, wide gangs, and relevant disable options.
- Run LLVM 20–24 checks, existing functional/lit suites, and external-corpus comparisons.
- Compare warmed, repeated whole-kernel timings against both the preceding revision and the fixed baseline; investigate reproducible slowdowns below the dashboard threshold.
- Track compile time, code size, and spills. Use native hardware for performance decisions; SDE supplies correctness and instruction evidence.
First PR: introduce the access decoder and read-only base/offset analysis feeding existing emission, with unchanged assembly and diagnostics.
- Ngôn ngữ chính
- C++
- Star
- 3k
- Fork
- 361
- Merge trung bình
- 23 giờ 43 phút
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 ispc/ispc
-
Quality of Life
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Crash Frontend / Parser Templates
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Unsigned 32-bit gather index is scaled with nsw before zero-extension (poison for offsets above INT32_MAX)Có thể đã có người làm @aneshlya đã nhận 1 ngày trước. Đang mởCodegen
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
ispc/ispc#3985 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GatherCoalescePass uses wrong addresses for negative constant offsets with --addressing=32Có thể đã có người làm @aneshlya đã nhận 1 ngày trước. Đang mởCodegen
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
ispc/ispc#3984 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Codegen Performance
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
good first issue invalid
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
DanielJerolm/gpcc#74 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
patrick-hudson/put.gd-desktop#808 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DPI change is not fully handled in the cascading window on WindowsCó thể đã có người làm @yukawa đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement Ready for final check
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
mpogue2/SquareDesk#1818 · 1 bình luận ·